summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-06-07 18:09:13 +0000
committerMoonchild <moonchild@palemoon.org>2020-06-07 18:09:13 +0000
commitfbab1f4f9eab329cc3c807ac4606afe194cea51b (patch)
tree8f887c2d12e6c30e484b6814c1d1d0be8c9ba07c
parent90c42b7afda8ddab70e9fb67b006248afce8e083 (diff)
downloadUXP-fbab1f4f9eab329cc3c807ac4606afe194cea51b.tar
UXP-fbab1f4f9eab329cc3c807ac4606afe194cea51b.tar.gz
UXP-fbab1f4f9eab329cc3c807ac4606afe194cea51b.tar.lz
UXP-fbab1f4f9eab329cc3c807ac4606afe194cea51b.tar.xz
UXP-fbab1f4f9eab329cc3c807ac4606afe194cea51b.zip
[DOM] Hard-disable webcomponents and customelements prefs (redwood)
-rw-r--r--dom/base/CustomElementRegistry.cpp3
-rw-r--r--dom/base/nsDocument.cpp15
-rw-r--r--modules/libpref/init/all.js2
3 files changed, 13 insertions, 7 deletions
diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp
index f582d635f..3f8322199 100644
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -166,8 +166,11 @@ NS_INTERFACE_MAP_END
/* static */ bool
CustomElementRegistry::IsCustomElementEnabled(JSContext* aCx, JSObject* aObject)
{
+ return false;
+/*
return Preferences::GetBool("dom.webcomponents.customelements.enabled") ||
Preferences::GetBool("dom.webcomponents.enabled");
+*/
}
/* static */ already_AddRefed<CustomElementRegistry>
diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp
index 380593737..81e2783a4 100644
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -5709,9 +5709,9 @@ nsDocument::IsWebComponentsEnabled(JSContext* aCx, JSObject* aObject)
{
JS::Rooted<JSObject*> obj(aCx, aObject);
- if (Preferences::GetBool("dom.webcomponents.enabled")) {
- return true;
- }
+ //if (Preferences::GetBool("dom.webcomponents.enabled")) {
+ // return true;
+ //}
// Check for the webcomponents permission. See Bug 1181555.
JSAutoCompartment ac(aCx, obj);
@@ -5725,9 +5725,9 @@ nsDocument::IsWebComponentsEnabled(JSContext* aCx, JSObject* aObject)
bool
nsDocument::IsWebComponentsEnabled(dom::NodeInfo* aNodeInfo)
{
- if (Preferences::GetBool("dom.webcomponents.enabled")) {
- return true;
- }
+ //if (Preferences::GetBool("dom.webcomponents.enabled")) {
+ // return true;
+ //}
nsIDocument* doc = aNodeInfo->GetDocument();
// Use GetScopeObject() here so that data documents work the same way as the
@@ -5740,6 +5740,7 @@ nsDocument::IsWebComponentsEnabled(dom::NodeInfo* aNodeInfo)
bool
nsDocument::IsWebComponentsEnabled(nsPIDOMWindowInner* aWindow)
{
+/*
if (aWindow) {
nsresult rv;
nsCOMPtr<nsIPermissionManager> permMgr =
@@ -5753,7 +5754,7 @@ nsDocument::IsWebComponentsEnabled(nsPIDOMWindowInner* aWindow)
return perm == nsIPermissionManager::ALLOW_ACTION;
}
-
+*/
return false;
}
diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js
index 0193c5ef1..17413b537 100644
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1248,8 +1248,10 @@ pref("privacy.trackingprotection.pbmode.enabled", false);
pref("dom.event.contextmenu.enabled", true);
pref("dom.event.clipboardevents.enabled", true);
+/*
pref("dom.webcomponents.enabled", false);
pref("dom.webcomponents.customelements.enabled", false);
+*/
pref("javascript.enabled", true);
// Enable Array.prototype.values