aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/frontend-initialize.js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-03-22 03:29:09 +0200
committersiikamiika <siikamiika@users.noreply.github.com>2020-04-05 19:57:37 +0300
commit9fe1e38afb056164dbcc4369160bb9fd4790a2c0 (patch)
treeb7770f33bd2b0d883e4ae6737c5bf8fcc5011c7c /ext/fg/js/frontend-initialize.js
parentd20ece9f074bb9d241a902f29344e5906e3c8210 (diff)
refactor
Diffstat (limited to 'ext/fg/js/frontend-initialize.js')
-rw-r--r--ext/fg/js/frontend-initialize.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/ext/fg/js/frontend-initialize.js b/ext/fg/js/frontend-initialize.js
index 777291fe..51fa8d7a 100644
--- a/ext/fg/js/frontend-initialize.js
+++ b/ext/fg/js/frontend-initialize.js
@@ -40,23 +40,26 @@ async function main() {
chrome.runtime.onMessage.removeListener(runtimeMessageCallback);
callback();
rootPopupInformationResolve(params);
- return false;
}
};
chrome.runtime.onMessage.addListener(runtimeMessageCallback);
- apiForward('rootPopupInformationGet');
+ apiForward('rootPopupRequestInformationBroadcast');
const {popupId, frameId} = await rootPopupInformationPromise;
- window._frameOffsetForwarder = new FrameOffsetForwarder();
- const applyFrameOffset = window._frameOffsetForwarder.applyOffset.bind(window._frameOffsetForwarder);
+ const frameOffsetForwarder = new FrameOffsetForwarder();
+ frameOffsetForwarder.start();
+ const applyFrameOffset = frameOffsetForwarder.applyOffset.bind(frameOffsetForwarder);
+
popup = new PopupProxy(popupId, 0, null, frameId, url, applyFrameOffset);
await popup.prepare();
} else if (proxy) {
popup = new PopupProxy(null, depth + 1, id, parentFrameId, url);
await popup.prepare();
} else {
- window._frameOffsetForwarder = new FrameOffsetForwarder();
+ const frameOffsetForwarder = new FrameOffsetForwarder();
+ frameOffsetForwarder.start();
+
const popupHost = new PopupProxyHost();
await popupHost.prepare();