diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-02-14 15:53:35 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-14 15:53:35 -0500 |
commit | 286534e648af350d24fbf3c7892a7ec81aaeb4bd (patch) | |
tree | 89d88e961c5a0a6f508c66789e30b9ba4a968e73 /ext/js/comm/frame-offset-forwarder.js | |
parent | efe8140f103179f50b610f182148b9427af99010 (diff) |
Move api to yomichan object (#1392)
* Move cross frame API from API to Yomichan
* Add API instance to Yomichan
* Move api global to yomichan.api
* Pass yomichan to API
* Remove IIFE
Diffstat (limited to 'ext/js/comm/frame-offset-forwarder.js')
-rw-r--r-- | ext/js/comm/frame-offset-forwarder.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/js/comm/frame-offset-forwarder.js b/ext/js/comm/frame-offset-forwarder.js index 0a0b4a18..2382a9fa 100644 --- a/ext/js/comm/frame-offset-forwarder.js +++ b/ext/js/comm/frame-offset-forwarder.js @@ -17,7 +17,6 @@ /* global * FrameAncestryHandler - * api */ class FrameOffsetForwarder { @@ -28,7 +27,7 @@ class FrameOffsetForwarder { prepare() { this._frameAncestryHandler.prepare(); - api.crossFrame.registerHandlers([ + yomichan.crossFrame.registerHandlers([ ['FrameOffsetForwarder.getChildFrameRect', {async: false, handler: this._onMessageGetChildFrameRect.bind(this)}] ]); } @@ -43,7 +42,7 @@ class FrameOffsetForwarder { let childFrameId = this._frameId; const promises = []; for (const frameId of ancestorFrameIds) { - promises.push(api.crossFrame.invoke(frameId, 'FrameOffsetForwarder.getChildFrameRect', {frameId: childFrameId})); + promises.push(yomichan.crossFrame.invoke(frameId, 'FrameOffsetForwarder.getChildFrameRect', {frameId: childFrameId})); childFrameId = frameId; } |