From dc22c0260e55121b2930f8bf8761271ba977503f Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Wed, 7 Feb 2024 02:55:48 -0500 Subject: Update application init process (#634) --- ext/js/comm/cross-frame-api.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'ext/js/comm') diff --git a/ext/js/comm/cross-frame-api.js b/ext/js/comm/cross-frame-api.js index eb9bed38..8fbee20c 100644 --- a/ext/js/comm/cross-frame-api.js +++ b/ext/js/comm/cross-frame-api.js @@ -291,8 +291,10 @@ export class CrossFrameAPIPort extends EventDispatcher { export class CrossFrameAPI { /** * @param {import('../comm/api.js').API} api + * @param {?number} tabId + * @param {?number} frameId */ - constructor(api) { + constructor(api, tabId, frameId) { /** @type {import('../comm/api.js').API} */ this._api = api; /** @type {number} */ @@ -306,15 +308,14 @@ export class CrossFrameAPI { /** @type {(port: CrossFrameAPIPort) => void} */ this._onDisconnectBind = this._onDisconnect.bind(this); /** @type {?number} */ - this._tabId = null; + this._tabId = tabId; /** @type {?number} */ - this._frameId = null; + this._frameId = frameId; } /** */ - async prepare() { + prepare() { chrome.runtime.onConnect.addListener(this._onConnect.bind(this)); - ({tabId: this._tabId = null, frameId: this._frameId = null} = await this._api.frameInformationGet()); } /** -- cgit v1.2.3