Skip to content

Commit

Permalink
Bug 1038604 - Rename disableMCB to allowMixedContent. r=dao
Browse files Browse the repository at this point in the history
  • Loading branch information
rmottola committed Aug 25, 2019
1 parent 5236b88 commit 2df2b92
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions browser/base/content/browser.js
Expand Up @@ -5079,22 +5079,22 @@ function handleLinkClick(event, href, linkNode) {
// if the mixedContentChannel is present and the referring URI passes
// a same origin check with the target URI, we can preserve the users
// decision of disabling MCB on a page for it's child tabs.
var persistDisableMCBInChildTab = false;
var persistAllowMixedContentInChildTab = false;

if (where == "tab" && gBrowser.docShell.mixedContentChannel) {
const sm = Services.scriptSecurityManager;
try {
var targetURI = makeURI(href);
sm.checkSameOriginURI(referrerURI, targetURI, false);
persistDisableMCBInChildTab = true;
persistAllowMixedContentInChildTab = true;
}
catch (e) { }
}

urlSecurityCheck(href, doc.nodePrincipal);
openLinkIn(href, where, { referrerURI: referrerURI,
charset: doc.characterSet,
disableMCB: persistDisableMCBInChildTab});
allowMixedContent: persistAllowMixedContentInChildTab });
event.preventDefault();
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions browser/base/content/nsContextMenu.js
Expand Up @@ -767,22 +767,22 @@ nsContextMenu.prototype = {
// if the mixedContentChannel is present and the referring URI passes
// a same origin check with the target URI, we can preserve the users
// decision of disabling MCB on a page for it's child tabs.
var persistDisableMCBInChildTab = false;
var persistAllowMixedContentInChildTab = false;

if (this.browser.docShell && this.browser.docShell.mixedContentChannel) {
const sm = Services.scriptSecurityManager;
try {
var targetURI = this.linkURI;
sm.checkSameOriginURI(referrerURI, targetURI, false);
persistDisableMCBInChildTab = true;
persistAllowMixedContentInChildTab = true;
}
catch (e) { }
}

openLinkIn(this.linkURL, "tab",
{ charset: doc.characterSet,
referrerURI: referrerURI,
disableMCB: persistDisableMCBInChildTab});
allowMixedContent: persistAllowMixedContentInChildTab });
},

// open URL in current tab
Expand Down
12 changes: 6 additions & 6 deletions browser/base/content/tabbrowser.xml
Expand Up @@ -1254,7 +1254,7 @@
<![CDATA[
var aFromExternal;
var aRelatedToCurrent;
var aDisableMCB;
var aAllowMixedContent;
if (arguments.length == 2 &&
typeof arguments[1] == "object" &&
!(arguments[1] instanceof Ci.nsIURI)) {
Expand All @@ -1266,7 +1266,7 @@
aAllowThirdPartyFixup = params.allowThirdPartyFixup;
aFromExternal = params.fromExternal;
aRelatedToCurrent = params.relatedToCurrent;
aDisableMCB = params.disableMCB;
aAllowMixedContent = params.allowMixedContent;
}
var bgLoad = (aLoadInBackground != null) ? aLoadInBackground :
Expand All @@ -1280,7 +1280,7 @@
allowThirdPartyFixup: aAllowThirdPartyFixup,
fromExternal: aFromExternal,
relatedToCurrent: aRelatedToCurrent,
disableMCB: aDisableMCB});
allowMixedContent: aAllowMixedContent});
if (!bgLoad)
this.selectedTab = tab;
Expand Down Expand Up @@ -1354,7 +1354,7 @@
var aFromExternal;
var aRelatedToCurrent;
var aSkipAnimation;
var aDisableMCB;
var aAllowMixedContent;
if (arguments.length == 2 &&
typeof arguments[1] == "object" &&
!(arguments[1] instanceof Ci.nsIURI)) {
Expand All @@ -1367,7 +1367,7 @@
aFromExternal = params.fromExternal;
aRelatedToCurrent = params.relatedToCurrent;
aSkipAnimation = params.skipAnimation;
aDisableMCB = params.disableMCB;
aAllowMixedContent = params.allowMixedContent;
}
// if we're adding tabs, we're past interrupt mode, ditch the owner
Expand Down Expand Up @@ -1527,7 +1527,7 @@
}
if (aFromExternal)
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_FROM_EXTERNAL;
if (aDisableMCB)
if (aAllowMixedContent)
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_MIXED_CONTENT;
try {
b.loadURIWithFlags(aURI, flags, aReferrerURI, aCharset, aPostData);
Expand Down
4 changes: 2 additions & 2 deletions browser/base/content/utilityOverlay.js
Expand Up @@ -215,7 +215,7 @@ function openLinkIn(url, where, params) {
var aCharset = params.charset;
var aReferrerURI = params.referrerURI;
var aRelatedToCurrent = params.relatedToCurrent;
var aDisableMCB = params.disableMCB;
var aAllowMixedContent = params.allowMixedContent;
var aInBackground = params.inBackground;
var aDisallowInheritPrincipal = params.disallowInheritPrincipal;
var aInitiatingDoc = params.initiatingDoc;
Expand Down Expand Up @@ -330,7 +330,7 @@ function openLinkIn(url, where, params) {
inBackground: loadInBackground,
allowThirdPartyFixup: aAllowThirdPartyFixup,
relatedToCurrent: aRelatedToCurrent,
disableMCB: aDisableMCB});
allowMixedContent: aAllowMixedContent});
break;
}

Expand Down

0 comments on commit 2df2b92

Please sign in to comment.