diff options
author | siikamiika <siikamiika@users.noreply.github.com> | 2020-04-18 23:39:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-18 23:39:21 +0300 |
commit | 7a03ce0194fafb0c2e49994dc6efd33d5fdb6a07 (patch) | |
tree | 68a6bc438180e9b3871cee4755a78b18ba3fa3e1 /ext/fg/js/popup-proxy.js | |
parent | 5b3d7fadc3534ba27eee971dac4ba5ee475c4e3d (diff) | |
parent | d66ca93ce4d6a4c9814bac4cc508c24ff87b8f69 (diff) |
Merge pull request #460 from siikamiika/iframe-popup-edge-cases
Iframe popup edge cases
Diffstat (limited to 'ext/fg/js/popup-proxy.js')
-rw-r--r-- | ext/fg/js/popup-proxy.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/fg/js/popup-proxy.js b/ext/fg/js/popup-proxy.js index 82ad9a8f..3af83db2 100644 --- a/ext/fg/js/popup-proxy.js +++ b/ext/fg/js/popup-proxy.js @@ -20,7 +20,7 @@ */ class PopupProxy { - constructor(id, depth, parentId, parentFrameId, url, getFrameOffset=null) { + constructor(id, depth, parentId, parentFrameId, url, getFrameOffset=null, setDisabled=null) { this._parentId = parentId; this._parentFrameId = parentFrameId; this._id = id; @@ -28,6 +28,7 @@ class PopupProxy { this._url = url; this._apiSender = new FrontendApiSender(); this._getFrameOffset = getFrameOffset; + this._setDisabled = setDisabled; this._frameOffset = null; this._frameOffsetPromise = null; @@ -142,6 +143,10 @@ class PopupProxy { try { const offset = await this._frameOffsetPromise; this._frameOffset = offset !== null ? offset : [0, 0]; + if (offset === null && this._setDisabled !== null) { + this._setDisabled(); + return; + } this._frameOffsetUpdatedAt = now; } catch (e) { logError(e); |