Tighten sandboxed scripts Part 1

Add a chrome and XBL accessor for the sandboxed scripts flag to Document WEBIDL.
This also includes changes to use the new function instead of getting and checking the sandbox flags in most places.
This commit is contained in:
wolfbeast
2016-08-10 16:18:57 +02:00
committed by roytam1
parent 3d3acb549a
commit dfab0d5603
6 changed files with 19 additions and 5 deletions
+2 -2
View File
@@ -304,7 +304,7 @@ nsScriptLoader::StartLoad(nsScriptLoadRequest *aRequest, const nsAString &aType,
nsCOMPtr<nsIInterfaceRequestor> prompter(do_QueryInterface(docshell));
// If this document is sandboxed without 'allow-scripts', abort.
if (mDocument->GetSandboxFlags() & SANDBOXED_SCRIPTS) {
if (mDocument->HasScriptsBlockedBySandbox()) {
return NS_OK;
}
@@ -729,7 +729,7 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
// inline script
// Is this document sandboxed without 'allow-scripts'?
if (mDocument->GetSandboxFlags() & SANDBOXED_SCRIPTS) {
if (mDocument->HasScriptsBlockedBySandbox()) {
return false;
}