Merge pull request #211 from toasted-nutbread/validate-content-window
Validate contentWindow before focus
This commit is contained in:
commit
88a6128e39
@ -239,9 +239,12 @@ class Popup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
focusParent() {
|
focusParent() {
|
||||||
if (this.parent && this.parent.container) {
|
if (this.parent !== null) {
|
||||||
// Chrome doesn't like focusing iframe without contentWindow.
|
// 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 {
|
} else {
|
||||||
// Firefox doesn't like focusing window without first blurring the iframe.
|
// 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.contentWindow.blur() doesn't work on Firefox for some reason.
|
||||||
|
Loading…
Reference in New Issue
Block a user