mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
CSP: Ignore nonces on <img> per spec
This commit is contained in:
parent
54e7645cb6
commit
7de286b67c
5 changed files with 111 additions and 4 deletions
|
|
@ -156,10 +156,13 @@ nsCSPContext::ShouldLoad(nsContentPolicyType aContentType,
|
|||
nsAutoString nonce;
|
||||
bool parserCreated = false;
|
||||
if (!isPreload) {
|
||||
nsCOMPtr<nsIDOMHTMLElement> htmlElement = do_QueryInterface(aRequestContext);
|
||||
if (htmlElement) {
|
||||
rv = htmlElement->GetAttribute(NS_LITERAL_STRING("nonce"), nonce);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (aContentType == nsIContentPolicy::TYPE_SCRIPT ||
|
||||
aContentType == nsIContentPolicy::TYPE_STYLESHEET) {
|
||||
nsCOMPtr<nsIDOMHTMLElement> htmlElement = do_QueryInterface(aRequestContext);
|
||||
if (htmlElement) {
|
||||
rv = htmlElement->GetAttribute(NS_LITERAL_STRING("nonce"), nonce);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIScriptElement> script = do_QueryInterface(aRequestContext);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue