aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index e6e93a76..e6596a1a 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -17,6 +17,7 @@
*/
/* global
+ * apiForward
* apiGetMessageToken
* apiInjectStylesheet
*/
@@ -79,6 +80,20 @@ class Popup {
return false;
}
+ async 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});
+ }
+ }
+
async setOptions(options) {
this._options = options;
this.updateTheme();
@@ -202,6 +217,10 @@ class Popup {
// NOP
}
+ if (this._depth === 0) {
+ apiForward('rootPopupInformation', {popupId: this._id, frameId: this._frameId});
+ }
+
if (this._messageToken === null) {
this._messageToken = await apiGetMessageToken();
}