aboutsummaryrefslogtreecommitdiff
path: root/ext/js/comm/cross-frame-api.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-07 02:55:48 -0500
committerGitHub <noreply@github.com>2024-02-07 07:55:48 +0000
commitdc22c0260e55121b2930f8bf8761271ba977503f (patch)
tree1c5cf6d59fb600dfc03e46f11d3fba3dfb30c8f1 /ext/js/comm/cross-frame-api.js
parent376bac7195bf2114da8b234ffa64af9751b4466d (diff)
Update application init process (#634)
Diffstat (limited to 'ext/js/comm/cross-frame-api.js')
-rw-r--r--ext/js/comm/cross-frame-api.js11
1 files changed, 6 insertions, 5 deletions
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());
}
/**