diff options
author | siikamiika <siikamiika@users.noreply.github.com> | 2020-04-04 16:48:35 +0300 |
---|---|---|
committer | siikamiika <siikamiika@users.noreply.github.com> | 2020-04-05 19:57:37 +0300 |
commit | 559033f0a6c2c8c298bd305065e475f0b385cd17 (patch) | |
tree | caf58dd8a4d259f737a3a3de9974d148ff20f810 /ext/fg/js/popup-proxy.js | |
parent | c171503d77bbae21ddfa2eb49c6a571440f41763 (diff) |
default to [0, 0] when sourceFrame is not found
Diffstat (limited to 'ext/fg/js/popup-proxy.js')
-rw-r--r-- | ext/fg/js/popup-proxy.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/fg/js/popup-proxy.js b/ext/fg/js/popup-proxy.js index fd07ee46..67b0b2c6 100644 --- a/ext/fg/js/popup-proxy.js +++ b/ext/fg/js/popup-proxy.js @@ -138,7 +138,8 @@ class PopupProxy { this._frameOffsetPromise = this._getFrameOffset(); if (firstRun) { try { - this._frameOffset = await this._frameOffsetPromise; + const offset = await this._frameOffsetPromise; + this._frameOffset = offset !== null ? offset : [0, 0]; this._frameOffsetUpdatedAt = Date.now(); } catch (e) { console.error(e); @@ -146,7 +147,7 @@ class PopupProxy { this._frameOffsetPromise = null; } else { this._frameOffsetPromise.then((offset) => { - this._frameOffset = offset; + this._frameOffset = offset !== null ? offset : [0, 0]; this._frameOffsetUpdatedAt = Date.now(); this._frameOffsetPromise = null; }, (e) => { |