Skip to content

Commit

Permalink
Avoid CPOWs in isPrivateContent()
Browse files Browse the repository at this point in the history
  • Loading branch information
Infocatcher committed Mar 3, 2016
1 parent 2ecb22d commit afbe4a8
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -4126,17 +4126,15 @@ var privateTab = {
return window && PrivateBrowsingUtils._privateTabOrigIsWindowPrivate(window);
},
isPrivateContent: function(window) {
try {
var tab = window.gBrowser.selectedTab;
if(!this.isRemoteTab(tab)) try {
return this.isPrivateWindow(this.getContentWindow(window));
}
catch(e) {
_log(
"isPrivateContent() failed. Electrolysis? Fallback to check private attribute"
+ (_dbgv ? ". Call stack:\n" + new Error().stack : "")
);
_dbgv && Components.utils.reportError(e);
_log("isPrivateContent() failed, call stack:\n" + new Error().stack);
Components.utils.reportError(e);
}
return window.gBrowser.selectedTab.hasAttribute(this.privateAttr);
return tab.hasAttribute(this.privateAttr);
},
getContentWindow: function(window) {
// Note: with enabled Electrolysis window.content may refers to
Expand Down

0 comments on commit afbe4a8

Please sign in to comment.