aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index 1b15977b..8953cf30 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -239,9 +239,12 @@ class Popup {
}
focusParent() {
- if (this.parent && this.parent.container) {
+ if (this.parent !== null) {
// Chrome doesn't like focusing iframe without contentWindow.
- this.parent.container.contentWindow.focus();
+ const contentWindow = this.parent.container.contentWindow;
+ if (contentWindow !== null) {
+ contentWindow.focus();
+ }
} else {
// Firefox doesn't like focusing window without first blurring the iframe.
// this.container.contentWindow.blur() doesn't work on Firefox for some reason.
@@ -251,7 +254,7 @@ class Popup {
}
}
- async containsPoint({x, y}) {
+ async containsPoint(x, y) {
for (let popup = this; popup !== null && popup.isVisible(); popup = popup.child) {
const rect = popup.container.getBoundingClientRect();
if (x >= rect.left && y >= rect.top && x < rect.right && y < rect.bottom) {