aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-03-19 00:00:42 +0200
committersiikamiika <siikamiika@users.noreply.github.com>2020-04-05 19:57:37 +0300
commit6806e7055f312ad1ff382118255ffe1004b7eace (patch)
tree018c02d893996f887d2b4a2fe71c6ded5610d18a /ext/fg/js/popup.js
parent3684a479c5e12efe63c54e5532a264d157a6816d (diff)
show iframe popups in root frame
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();
}