aboutsummaryrefslogtreecommitdiff
path: root/ext/js/comm
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-12-20 00:18:55 -0500
committerGitHub <noreply@github.com>2023-12-20 05:18:55 +0000
commit3c226215419ca815712e9568f7d871a96f5ff1cf (patch)
tree8bfe561a0d36589860b64c1758c2e29e92e7e3f4 /ext/js/comm
parente0e29dc1aa0965b3e0fb97de64a27c2b695e068b (diff)
Simplify message handlers (#396)
Diffstat (limited to 'ext/js/comm')
-rw-r--r--ext/js/comm/cross-frame-api.js2
-rw-r--r--ext/js/comm/frame-ancestry-handler.js4
-rw-r--r--ext/js/comm/frame-offset-forwarder.js2
3 files changed, 5 insertions, 3 deletions
diff --git a/ext/js/comm/cross-frame-api.js b/ext/js/comm/cross-frame-api.js
index 0d3f3275..023ca18e 100644
--- a/ext/js/comm/cross-frame-api.js
+++ b/ext/js/comm/cross-frame-api.js
@@ -351,7 +351,7 @@ export class CrossFrameAPI {
}
/**
- * @param {import('core').MessageHandlerArray} messageHandlers
+ * @param {import('core').MessageHandlerMapInit} messageHandlers
* @throws {Error}
*/
registerHandlers(messageHandlers) {
diff --git a/ext/js/comm/frame-ancestry-handler.js b/ext/js/comm/frame-ancestry-handler.js
index b91046bc..261ea943 100644
--- a/ext/js/comm/frame-ancestry-handler.js
+++ b/ext/js/comm/frame-ancestry-handler.js
@@ -164,7 +164,9 @@ export class FrameAncestryHandler {
};
// Start
- yomitan.crossFrame.registerHandlers([[responseMessageId, {async: false, handler: onMessage}]]);
+ yomitan.crossFrame.registerHandlers([
+ [responseMessageId, onMessage]
+ ]);
resetTimeout();
const frameId = this._frameId;
this._requestFrameInfo(targetWindow, frameId, frameId, uniqueId, nonce);
diff --git a/ext/js/comm/frame-offset-forwarder.js b/ext/js/comm/frame-offset-forwarder.js
index af9bd268..afa6a5e6 100644
--- a/ext/js/comm/frame-offset-forwarder.js
+++ b/ext/js/comm/frame-offset-forwarder.js
@@ -36,7 +36,7 @@ export class FrameOffsetForwarder {
prepare() {
this._frameAncestryHandler.prepare();
yomitan.crossFrame.registerHandlers([
- ['FrameOffsetForwarder.getChildFrameRect', {async: false, handler: this._onMessageGetChildFrameRect.bind(this)}]
+ ['FrameOffsetForwarder.getChildFrameRect', this._onMessageGetChildFrameRect.bind(this)]
]);
}