1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 13:58:49 +00:00

[image] Use the TriggeringPrincipal if we have one, not the SystemPrincipal

This commit is contained in:
Moonchild
2025-12-15 18:00:45 +01:00
committed by roytam1
parent 68fa0f0d54
commit 4667b7f4b0
+5 -2
View File
@@ -751,10 +751,13 @@ NewImageChannel(nsIChannel** aResult,
// outside a document, in which case the triggeringPrincipal and
// triggeringPrincipal should always be the systemPrincipal.
// However, there are exceptions: one is Notifications which create a
// channel in the parent prcoess in which case we can't get a requestingNode.
// channel separate from content, in which case we can't get a
// requestingNode while we might still have a valid triggering principal.
// Use the triggering principal if we have a valid one, fall back to
// the system principal if we don't.
rv = NS_NewChannel(aResult,
aURI,
nsContentUtils::GetSystemPrincipal(),
aTriggeringPrincipal ? aTriggeringPrincipal : nsContentUtils::GetSystemPrincipal(),
securityFlags,
aPolicyType,
nullptr, // loadGroup