mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 05:37:11 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user