Skip to content

Commit

Permalink
Refactor: add isMultiProcessWindow() function
Browse files Browse the repository at this point in the history
  • Loading branch information
Infocatcher committed Feb 26, 2016
1 parent 70ceefe commit b6e2db3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ var privateTab = {
window.addEventListener("dragend", this, true);
window.addEventListener("drop", this, true);
window.addEventListener("PrivateTab:PrivateChanged", this, false);
if("gMultiProcessBrowser" in window && window.gMultiProcessBrowser)
if(this.isMultiProcessWindow(window))
window.addEventListener("TabRemotenessChange", this, true);
window.addEventListener("SSWindowStateBusy", this, true);
window.addEventListener("SSWindowStateReady", this, true);
Expand Down Expand Up @@ -543,7 +543,7 @@ var privateTab = {
window.removeEventListener("drop", this, true);
window.removeEventListener(this.keyEvent, this, this.keyHighPriority);
window.removeEventListener("PrivateTab:PrivateChanged", this, false);
if("gMultiProcessBrowser" in window && window.gMultiProcessBrowser)
if(this.isMultiProcessWindow(window))
window.removeEventListener("TabRemotenessChange", this, true);
window.removeEventListener("SSWindowStateBusy", this, true);
window.removeEventListener("SSWindowStateReady", this, true);
Expand Down Expand Up @@ -2357,7 +2357,7 @@ var privateTab = {
sendReferer > 0
&& (sendReferer > 1 || this.isPrivateWindow(sourceDocument.defaultView))
) {
referer = "gMultiProcessBrowser" in window && window.gMultiProcessBrowser
referer = this.isMultiProcessWindow(window)
? Services.io.newURI(sourceDocument.documentURI, null, null)
: sourceDocument.documentURIObject;
}
Expand Down Expand Up @@ -4066,6 +4066,9 @@ var privateTab = {
return window.gBrowser.contentWindow
|| window.gBrowser.contentWindowAsCPOW;
},
isMultiProcessWindow: function(window) {
return "gMultiProcessBrowser" in window && window.gMultiProcessBrowser;
},
getTabPrivacyContext: function(tab, _silent) {
var browser = tab.linkedBrowser;
if(!browser) {
Expand Down

0 comments on commit b6e2db3

Please sign in to comment.