mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
Merge f4988328be
into 7c8be12d52
This commit is contained in:
commit
40f3721268
2 changed files with 17 additions and 0 deletions
|
@ -125,6 +125,7 @@ class Manager {
|
||||||
window.addEventListener("focus", this.window.windowFocus.bind(this.window));
|
window.addEventListener("focus", this.window.windowFocus.bind(this.window));
|
||||||
window.addEventListener("statechange", this.app.stateChange.bind(this.app));
|
window.addEventListener("statechange", this.app.stateChange.bind(this.app));
|
||||||
window.addEventListener("popstate", this.app.popState.bind(this.app));
|
window.addEventListener("popstate", this.app.popState.bind(this.app));
|
||||||
|
window.addEventListener("message", this.input.handlePostMessage.bind(this.input));
|
||||||
|
|
||||||
// Controls
|
// Controls
|
||||||
document.getElementById("bake").addEventListener("click", this.controls.bakeClick.bind(this.controls));
|
document.getElementById("bake").addEventListener("click", this.controls.bakeClick.bind(this.controls));
|
||||||
|
|
|
@ -1654,6 +1654,22 @@ class InputWaiter {
|
||||||
this.changeTab(inputNum, this.app.options.syncTabs);
|
this.changeTab(inputNum, this.app.options.syncTabs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handler for incoming postMessages
|
||||||
|
* If the events data has a `type` property set to `dataSubmit`
|
||||||
|
* the value property is set to the current input
|
||||||
|
* @param {event} e
|
||||||
|
* @param {object} e.data
|
||||||
|
* @param {string} e.data.type - the type of request, currently the only value is "dataSubmit"
|
||||||
|
* @param {string} e.data.value - the value of the message
|
||||||
|
*/
|
||||||
|
handlePostMessage(e) {
|
||||||
|
if ("data" in e && "type" in e.data && "value" in e.data) {
|
||||||
|
if (e.data.type === "dataSubmit") {
|
||||||
|
this.setInput(e.data.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default InputWaiter;
|
export default InputWaiter;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue