No Issue - stop spewing useless xfo < CSP warning in non-debug builds

This warning throws off a lot of users reporting issues. It's not even
a proper warning as it's informative at best.
Leave it in for debug builds, but stop spewing these common notices in
release builds.
This commit is contained in:
Moonchild 2024-11-14 21:53:59 +01:00 committed by roytam1
commit 1f038cd026

View file

@ -427,6 +427,7 @@ ShouldIgnoreFrameOptions(nsIChannel* aChannel, nsIPrincipal* aPrincipal)
return false;
}
#ifdef DEBUG
// log warning to console that xfo is ignored because of CSP
nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
uint64_t innerWindowID = loadInfo ? loadInfo->GetInnerWindowID() : 0;
@ -440,7 +441,7 @@ ShouldIgnoreFrameOptions(nsIChannel* aChannel, nsIPrincipal* aPrincipal)
0, // no columnnumber
nsIScriptError::warningFlag,
"CSP", innerWindowID);
#endif
return true;
}