summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNika Layzell <nika@thelayzells.com>2022-05-05 17:03:51 -0500
committerMatt A. Tobin <email@mattatobin.com>2022-05-05 17:04:01 -0500
commitd670f8a50b8051c763b01e4125a0262954ab7b4a (patch)
tree0084dcb28b3a52de368752e85f99fc8dc29ee452
parent516f184cabdf97ddd50e27a8ed4a9b407298b4b7 (diff)
downloadaura-central-d670f8a50b8051c763b01e4125a0262954ab7b4a.tar.gz
Bug 1761981
-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;
}