mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 20:30:41 +00:00
Bug 1093642 - Part 2: Decide if we allow mixed content before sending click event to remote tab. r=tanvi.
This commit is contained in:
parent
c4d1435e06
commit
a516550b03
@ -406,6 +406,22 @@ var ClickEventHandler = {
|
||||
}
|
||||
json.noReferrer = BrowserUtils.linkHasNoReferrer(node)
|
||||
|
||||
// Check if the link needs to be opened with mixed content allowed.
|
||||
// Only when the owner doc has |mixedContentChannel| and the same origin
|
||||
// should we allow mixed content.
|
||||
json.allowMixedContent = false;
|
||||
let docshell = ownerDoc.defaultView.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShell);
|
||||
if (docShell.mixedContentChannel) {
|
||||
const sm = Services.scriptSecurityManager;
|
||||
try {
|
||||
let targetURI = BrowserUtils.makeURI(href);
|
||||
sm.checkSameOriginURI(docshell.mixedContentChannel.URI, targetURI, false);
|
||||
json.allowMixedContent = true;
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
sendAsyncMessage("Content:Click", json);
|
||||
return;
|
||||
}
|
||||
|
@ -80,7 +80,9 @@ var ContentClick = {
|
||||
let params = { charset: browser.characterSet,
|
||||
referrerURI: browser.documentURI,
|
||||
referrerPolicy: json.referrerPolicy,
|
||||
noReferrer: json.noReferrer };
|
||||
noReferrer: json.noReferrer,
|
||||
allowMixedContent: json.allowMixedContent };
|
||||
|
||||
window.openLinkIn(json.href, where, params);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user