Bug 1761981

This commit is contained in:
Moonchild 2022-05-04 22:00:02 +00:00 committed by roytam1
commit 28821219dd

View file

@ -202,7 +202,12 @@ nsresult nsJSThunk::EvaluateScript(nsIChannel *aChannel,
// Sandboxed document check: javascript: URI's are disabled
// in a sandboxed document unless 'allow-scripts' was specified.
nsIDocument* doc = aOriginalInnerWindow->GetExtantDoc();
if (doc && !doc->IsScriptEnabled()) {
// Scripts not allowed on the extant doc.
return NS_ERROR_DOM_RETVAL_UNDEFINED;
}
if (doc && doc->HasScriptsBlockedBySandbox()) {
// Sandbox policy forbids scripting.
return NS_ERROR_DOM_RETVAL_UNDEFINED;
}