mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 11:57:32 +09:00
moebius#230: Consider blocking top level window data: URIs (part 3/3 without tests)
https://github.com/MoonchildProductions/moebius/pull/230
This commit is contained in:
parent
73f89fe562
commit
18d312235d
20 changed files with 143 additions and 3 deletions
|
|
@ -1158,7 +1158,8 @@ nsContextMenu.prototype = {
|
|||
this.browser.contentPrincipal,
|
||||
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
||||
openUILink(this.mediaURL, e, { disallowInheritPrincipal: true,
|
||||
referrerURI: referrerURI });
|
||||
referrerURI: referrerURI,
|
||||
forceAllowDataURI: true });
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -197,6 +197,7 @@ function openUILinkIn(url, where, aAllowThirdPartyFixup, aPostData, aReferrerURI
|
|||
openLinkIn(url, where, params);
|
||||
}
|
||||
|
||||
/* eslint-disable complexity */
|
||||
function openLinkIn(url, where, params) {
|
||||
if (!where || !url)
|
||||
return;
|
||||
|
|
@ -212,6 +213,7 @@ function openLinkIn(url, where, params) {
|
|||
params.referrerPolicy : Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT);
|
||||
var aRelatedToCurrent = params.relatedToCurrent;
|
||||
var aAllowMixedContent = params.allowMixedContent;
|
||||
var aForceAllowDataURI = params.forceAllowDataURI;
|
||||
var aInBackground = params.inBackground;
|
||||
var aDisallowInheritPrincipal = params.disallowInheritPrincipal;
|
||||
var aInitiatingDoc = params.initiatingDoc;
|
||||
|
|
@ -378,6 +380,9 @@ function openLinkIn(url, where, params) {
|
|||
if (aIndicateErrorPageLoad) {
|
||||
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ERROR_LOAD_CHANGES_RV;
|
||||
}
|
||||
if (aForceAllowDataURI) {
|
||||
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_FORCE_ALLOW_DATA_URI;
|
||||
}
|
||||
|
||||
let {URI_INHERITS_SECURITY_CONTEXT} = Ci.nsIProtocolHandler;
|
||||
if (aForceAboutBlankViewerInCurrent &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue