summaryrefslogtreecommitdiff
path: root/dom
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-05-04 22:00:02 +0000
committerMoonchild <moonchild@palemoon.org>2022-05-04 22:00:02 +0000
commit9a84af4d5baffe87f7e42f41b992611c46681c3a (patch)
tree629f054da6906481e88ab57b6d6e79557da7138a /dom
parenteecc234b44e1d861f4c3d4187cb6e3d7b23bc846 (diff)
downloaduxp-9a84af4d5baffe87f7e42f41b992611c46681c3a.tar.gz
Bug 1761981
Diffstat (limited to 'dom')
-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 82d24d1334..b6584b8a58 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;
}