Skip to content

Commit

Permalink
Workaround for broken wrapper for gBrowser.setIcon()
Browse files Browse the repository at this point in the history
  • Loading branch information
Infocatcher committed Jul 21, 2015
1 parent 29c43a5 commit 06eab93
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ var privateTab = {
function before(tab, uri) {
if(!uri || _this.isPrivateWindow(window))
return;
var isPrivate = _this.isPrivateTab(tab);
var isPrivate = _this.isPrivateTab(tab); //~ todo: may work wrong with Electrolysis
if(!isPrivate)
return;
_log("[patcher] " + key + "(): isPrivate = " + isPrivate);
Expand Down Expand Up @@ -3828,16 +3828,31 @@ var privateTab = {
);
}
var window = tab.linkedBrowser.contentWindow;
if(!window || !("QueryInterface" in window)) {
try { // Yes, even this simple check may raise "cross-process JS call failed" error
if(!window || !("QueryInterface" in window))
throw "not usable";
}
catch(e) {
if(e != "not usable")
Components.utils.reportError(e);
Components.utils.reportError(
LOG_PREFIX
+ "getTabPrivacyContext(): tab.linkedBrowser.contentWindow is null or not usable. Electrolysis?"
+ "\nCall stack:\n" + new Error().stack
);
return null; // Nothing to do, sorry
}
return this.getPrivacyContext(window);
},
isPrivateTab: function(tab) {
return tab && this.getTabPrivacyContext(tab).usePrivateBrowsing;
var privacyContext = tab && this.getTabPrivacyContext(tab);
if(!privacyContext) {
Components.utils.reportError(
LOG_PREFIX
+ "isPrivateTab(): getTabPrivacyContext() failed. Electrolysis?"
);
}
return privacyContext && privacyContext.usePrivateBrowsing;
},
isPendingTab: function(tab) {
return tab.hasAttribute("pending");
Expand Down

0 comments on commit 06eab93

Please sign in to comment.