summaryrefslogtreecommitdiff
path: root/ext/fg
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2019-09-01 22:34:37 +0300
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-02 19:33:52 -0400
commitf4b81eff3054e4277e97d06290535bfecc9b9cc1 (patch)
treef5261191323cd4777e9792a9651b7a0be61f36f2 /ext/fg
parent2df9a7f97794df46aac70a23bb2b62dbd2752a5a (diff)
fix parent focus issues for Firefox and Chrome
Diffstat (limited to 'ext/fg')
-rw-r--r--ext/fg/js/popup.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index 3bc0b6f8..df7dc6b5 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -239,9 +239,15 @@ class Popup {
}
focusParent() {
- this.container.blur();
if (this.parent && this.parent.container) {
- this.parent.container.focus();
+ // Chrome doesn't like focusing iframe without contentWindow.
+ this.parent.container.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.
+ this.container.blur();
+ // This is needed for Chrome.
+ window.focus();
}
}