aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup-proxy.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/popup-proxy.js')
-rw-r--r--ext/fg/js/popup-proxy.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/fg/js/popup-proxy.js b/ext/fg/js/popup-proxy.js
index 3a15be7d..bbf6a2cf 100644
--- a/ext/fg/js/popup-proxy.js
+++ b/ext/fg/js/popup-proxy.js
@@ -18,12 +18,14 @@
class PopupProxy {
- constructor(parentId) {
+ constructor(parentId, parentFrameId) {
this.parentId = parentId;
+ this.parentFrameId = parentFrameId;
this.id = null;
this.idPromise = null;
this.parent = null;
this.children = [];
+ this.depth = 0;
this.container = null;
@@ -102,7 +104,10 @@ class PopupProxy {
}
invokeHostApi(action, params={}) {
- return this.apiSender.invoke(action, params, 'popup-proxy-host');
+ if (typeof this.parentFrameId !== 'number') {
+ return Promise.reject('Invalid frame');
+ }
+ return this.apiSender.invoke(action, params, `popup-proxy-host#${this.parentFrameId}`);
}
static DOMRectToJson(domRect) {