summaryrefslogtreecommitdiff
path: root/dom/jsurl/nsJSProtocolHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/jsurl/nsJSProtocolHandler.cpp')
-rw-r--r--dom/jsurl/nsJSProtocolHandler.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/dom/jsurl/nsJSProtocolHandler.cpp b/dom/jsurl/nsJSProtocolHandler.cpp
index 82d24d133..b6584b8a5 100644
--- a/dom/jsurl/nsJSProtocolHandler.cpp
+++ b/dom/jsurl/nsJSProtocolHandler.cpp
@@ -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;
}