aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();
}
}