diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-09-07 13:11:25 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-09-10 20:09:33 -0400 |
commit | 99ca60d4c1456f243d8142b4502db441e33340a4 (patch) | |
tree | b4a2743cd62f3c042d8a9e3d499dbaf4dfd94ec4 /ext/fg/js | |
parent | aae971a09e1b48d932126925521cf2d3ba34a41f (diff) |
Ensure both Popup and PopupProxy have valid depth
Diffstat (limited to 'ext/fg/js')
-rw-r--r-- | ext/fg/js/frontend.js | 4 | ||||
-rw-r--r-- | ext/fg/js/popup-proxy.js | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js index 83e0cef1..5e12d101 100644 --- a/ext/fg/js/frontend.js +++ b/ext/fg/js/frontend.js @@ -40,9 +40,9 @@ class Frontend { static create() { const initializationData = window.frontendInitializationData; const isNested = (initializationData !== null && typeof initializationData === 'object'); - const {id, parentFrameId, ignoreNodes} = isNested ? initializationData : {}; + const {id, depth, parentFrameId, ignoreNodes} = isNested ? initializationData : {}; - const popup = isNested ? new PopupProxy(id, parentFrameId) : PopupProxyHost.instance.createPopup(null); + const popup = isNested ? new PopupProxy(depth + 1, id, parentFrameId) : PopupProxyHost.instance.createPopup(null); const frontend = new Frontend(popup, ignoreNodes); frontend.prepare(); return frontend; diff --git a/ext/fg/js/popup-proxy.js b/ext/fg/js/popup-proxy.js index f6295079..56e710eb 100644 --- a/ext/fg/js/popup-proxy.js +++ b/ext/fg/js/popup-proxy.js @@ -18,14 +18,14 @@ class PopupProxy { - constructor(parentId, parentFrameId) { + constructor(depth, parentId, parentFrameId) { this.parentId = parentId; this.parentFrameId = parentFrameId; this.id = null; this.idPromise = null; this.parent = null; this.child = null; - this.depth = 0; + this.depth = depth; this.container = null; |