diff options
author | siikamiika <siikamiika@users.noreply.github.com> | 2020-03-19 00:24:14 +0200 |
---|---|---|
committer | siikamiika <siikamiika@users.noreply.github.com> | 2020-04-05 19:57:37 +0300 |
commit | b6c4914b79d96b06760093be8957fbb1730eff3b (patch) | |
tree | 568288a7b81aae03343c4550ff8da104d0c6b03b /ext/fg/js/popup.js | |
parent | 6806e7055f312ad1ff382118255ffe1004b7eace (diff) |
simplify popup prepare
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r-- | ext/fg/js/popup.js | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js index e6596a1a..5b8724ae 100644 --- a/ext/fg/js/popup.js +++ b/ext/fg/js/popup.js @@ -23,11 +23,10 @@ */ class Popup { - constructor(id, depth, frameIdPromise) { + constructor(id, depth, frameId) { this._id = id; this._depth = depth; - this._frameIdPromise = frameIdPromise; - this._frameId = null; + this._frameId = frameId; this._parent = null; this._child = null; this._childrenSupported = true; @@ -80,16 +79,8 @@ class Popup { return false; } - async broadcastRootPopupInformation() { + broadcastRootPopupInformation() { if (this._depth === 0) { - try { - const {frameId} = await this._frameIdPromise; - if (typeof frameId === 'number') { - this._frameId = frameId; - } - } catch (e) { - // NOP - } apiForward('rootPopupInformation', {popupId: this._id, frameId: this._frameId}); } } @@ -208,18 +199,7 @@ class Popup { } async _createInjectPromise() { - try { - const {frameId} = await this._frameIdPromise; - if (typeof frameId === 'number') { - this._frameId = frameId; - } - } catch (e) { - // NOP - } - - if (this._depth === 0) { - apiForward('rootPopupInformation', {popupId: this._id, frameId: this._frameId}); - } + this.broadcastRootPopupInformation(); if (this._messageToken === null) { this._messageToken = await apiGetMessageToken(); |