aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-02-14 02:33:54 +0200
committersiikamiika <siikamiika@users.noreply.github.com>2020-02-14 02:33:54 +0200
commit810a7e7d92d15412974810702d954de60453dd31 (patch)
tree9dc0e7744f2ac31a0b2707ade94a7ca1dde50363 /ext/fg/js/popup.js
parentd7e1ef01d8af4a315a31364eb5138e24a132ea1e (diff)
use sendMessage to notify about initialization
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js18
1 files changed, 2 insertions, 16 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index ad4e5181..b8233cc2 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -43,8 +43,6 @@ class Popup {
this._container.style.height = '0px';
this._updateVisibility();
-
- window.addEventListener('message', (e) => this.onMessage(e), false);
}
// Public properties
@@ -125,15 +123,7 @@ class Popup {
this._invokeApi('setContentScale', {scale});
}
- onMessage(e) {
- const action = e.data;
- const handler = Popup._windowMessageHandlers.get(action);
- if (typeof handler !== 'function') { return; }
-
- handler(this);
- }
-
- setInitialized() {
+ setDisplayInitialized() {
throw new Error('Override me');
}
@@ -244,7 +234,7 @@ class Popup {
childrenSupported: this._childrenSupported,
scale: this._contentScale
});
- this.setInitialized = resolve;
+ this.setDisplayInitialized = resolve;
});
this._observeFullscreen();
this._onFullscreenChanged();
@@ -540,8 +530,4 @@ class Popup {
}
}
-Popup._windowMessageHandlers = new Map([
- ['initialized', (self) => self.setInitialized()]
-]);
-
Popup.outerStylesheet = null;