aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup-proxy.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-08-22 14:33:41 -0400
committerGitHub <noreply@github.com>2020-08-22 14:33:41 -0400
commit1dc35dd6f13828a8d2a134de754ce54d33db4a86 (patch)
tree816f2ffcf724c1d50e7660370b57ca9d9a98b01e /ext/fg/js/popup-proxy.js
parente9c540a0b9a13b2ff4a77d76928682b45f1968d5 (diff)
Popup factory proxy creation (#745)
* Change getOrCreatePopup to async * Rename parentFrameId to frameId, expose frameId property * Update how proxy popups are created
Diffstat (limited to 'ext/fg/js/popup-proxy.js')
-rw-r--r--ext/fg/js/popup-proxy.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/ext/fg/js/popup-proxy.js b/ext/fg/js/popup-proxy.js
index 28f6b276..f1b3ab21 100644
--- a/ext/fg/js/popup-proxy.js
+++ b/ext/fg/js/popup-proxy.js
@@ -20,12 +20,11 @@
*/
class PopupProxy extends EventDispatcher {
- constructor(id, depth, parentPopupId, parentFrameId, ownerFrameId, frameOffsetForwarder=null) {
+ constructor(id, depth, frameId, ownerFrameId, frameOffsetForwarder=null) {
super();
this._id = id;
this._depth = depth;
- this._parentPopupId = parentPopupId;
- this._parentFrameId = parentFrameId;
+ this._frameId = frameId;
this._ownerFrameId = ownerFrameId;
this._frameOffsetForwarder = frameOffsetForwarder;
@@ -69,13 +68,12 @@ class PopupProxy extends EventDispatcher {
return null;
}
- // Public functions
-
- async prepare() {
- const {id} = await this._invoke('getOrCreatePopup', {id: this._id, parentId: this._parentPopupId, ownerFrameId: this._ownerFrameId});
- this._id = id;
+ get frameId() {
+ return this._frameId;
}
+ // Public functions
+
setOptionsContext(optionsContext, source) {
return this._invokeSafe('setOptionsContext', {id: this._id, optionsContext, source});
}
@@ -148,7 +146,7 @@ class PopupProxy extends EventDispatcher {
// Private
_invoke(action, params={}) {
- return api.crossFrame.invoke(this._parentFrameId, action, params);
+ return api.crossFrame.invoke(this._frameId, action, params);
}
async _invokeSafe(action, params={}, defaultReturnValue) {