mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-01 04:47:31 +09:00
Bug 1398229 - Save-link-as feature should use the loading principal - implementation of nsIContentPolicy.TYPE_SAVE_AS_DOWNLOAD
This commit is contained in:
parent
5f66b032f4
commit
97c6ecff55
7 changed files with 25 additions and 2 deletions
|
|
@ -471,6 +471,12 @@ DoContentSecurityChecks(nsIChannel* aChannel, nsILoadInfo* aLoadInfo)
|
|||
break;
|
||||
}
|
||||
|
||||
case nsIContentPolicy::TYPE_SAVEAS_DOWNLOAD: {
|
||||
mimeTypeGuess = EmptyCString();
|
||||
requestingContext = aLoadInfo->LoadingNode();
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
// nsIContentPolicy::TYPE_INVALID
|
||||
MOZ_ASSERT(false, "can not perform security check without a valid contentType");
|
||||
|
|
|
|||
|
|
@ -468,6 +468,13 @@ nsMixedContentBlocker::ShouldLoad(bool aHadInsecureImageRedirect,
|
|||
*aDecision = ACCEPT;
|
||||
return NS_OK;
|
||||
|
||||
// Creating insecure connections for a save-as link download is acceptable.
|
||||
// This download is completely disconnected from the docShell, but still
|
||||
// using the same loading principal.
|
||||
case TYPE_SAVEAS_DOWNLOAD:
|
||||
*aDecision = ACCEPT;
|
||||
return NS_OK;
|
||||
|
||||
// Static display content is considered moderate risk for mixed content so
|
||||
// these will be blocked according to the mixed display preference
|
||||
case TYPE_IMAGE:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue