Skip to content

Commit

Permalink
Safe way to handle source window with Element Properties extension
Browse files Browse the repository at this point in the history
(related to #20)
  • Loading branch information
Infocatcher committed May 24, 2016
1 parent 5d616bf commit 410aca5
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions chrome/content/linkPropsPlus.js
Expand Up @@ -1196,8 +1196,15 @@ var linkPropsPlusSvc = {
return this._uri = dialog.mLauncher.source.spec;
},
get realReferer() {
if(this.isPropsDialog)
return window.arguments[0].ownerDocument.documentURI;
if(this.isPropsDialog) {
try { // e10s + unsafe CPOW usage?
return window.arguments[0].ownerDocument.documentURI;
}
catch(e) {
Components.utils.reportError(e);
}
return this._uri;
}
if(this.isOwnWindow)
return this.wnd.referer;
var err;
Expand Down Expand Up @@ -1264,8 +1271,15 @@ var linkPropsPlusSvc = {
return this.ensureWindowOpened(this._sourceWindow);
},
get _sourceWindow() {
if(this.isPropsDialog)
return window.arguments[0].ownerDocument.defaultView;
if(this.isPropsDialog) {
try { // e10s + unsafe CPOW usage?
return window.arguments[0].ownerDocument.defaultView;
}
catch(e) {
Components.utils.reportError(e);
}
return null;
}
if(this.isOwnWindow)
return this.wnd.sourceWindow;

Expand Down

0 comments on commit 410aca5

Please sign in to comment.