Skip to content

Commit

Permalink
Reduce error messages and tweak debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Infocatcher committed Feb 26, 2016
1 parent 7c18fb7 commit a399940
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -4058,8 +4058,11 @@ var privateTab = {
return this.isPrivateWindow(this.getContentWindow(window));
}
catch(e) {
_log("isPrivateContent() failed. Electrolysis? Fallback to check private attribute");
Components.utils.reportError(e);
_log(
"isPrivateContent() failed. Electrolysis? Fallback to check private attribute"
+ (_dbgv ? ". Call stack:\n" + new Error().stack : "")
);
_dbgv && Components.utils.reportError(e);
}
return window.gBrowser.selectedTab.hasAttribute(this.privateAttr);
},
Expand All @@ -4085,18 +4088,22 @@ var privateTab = {
return this.getPrivacyContext(window);
}
catch(e) {
if(!_silent)
Components.utils.reportError(e);
_log("getTabPrivacyContext() failed. Electrolysis? Call stack:\n" + new Error().stack);
if(!_silent) {
_log(
"getTabPrivacyContext() failed. Electrolysis?"
+ (_dbgv ? " Call stack:\n" + new Error().stack : "")
);
_dbgv && Components.utils.reportError(e);
}
}
return null;
},
isPrivateTab: function(tab) {
var privacyContext = this.getTabPrivacyContext(tab);
if(!privacyContext) {
Components.utils.reportError(
LOG_PREFIX
+ "isPrivateTab(): getTabPrivacyContext() failed. Electrolysis?"
_log(
"isPrivateTab() failed. Electrolysis? Fallback to check private attribute"
+ (_dbgv ? ". Call stack:\n" + new Error().stack : "")
);
return tab.getAttribute(this.privateAttr) == "true";
}
Expand Down

0 comments on commit a399940

Please sign in to comment.