diff --git a/dom/apps/PermissionsTable.jsm b/dom/apps/PermissionsTable.jsm index ed4abd20f82..ca7b4a2694f 100644 --- a/dom/apps/PermissionsTable.jsm +++ b/dom/apps/PermissionsTable.jsm @@ -579,12 +579,6 @@ this.PermissionsTable = { geolocation: { privileged: DENY_ACTION, certified: ALLOW_ACTION }, - "moz-extremely-unstable-and-will-change-webcomponents": { - app: DENY_ACTION, - trusted: DENY_ACTION, - privileged: ALLOW_ACTION, - certified: ALLOW_ACTION - } }; /** diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index c85d9cc8d52..60c7ba424f9 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -92,7 +92,6 @@ #include "nsIAuthPrompt2.h" #include "nsIScriptSecurityManager.h" -#include "nsIPermissionManager.h" #include "nsIPrincipal.h" #include "nsIDOMWindow.h" @@ -5832,31 +5831,9 @@ nsDocument::CustomElementConstructor(JSContext* aCx, unsigned aArgc, JS::Value* bool nsDocument::IsWebComponentsEnabled(JSContext* aCx, JSObject* aObject) { - if (Preferences::GetBool("dom.webcomponents.enabled")) { - return true; - } - - // Check for the webcomponents permission. See Bug 1181555. - JSAutoCompartment ac(aCx, aObject); - JS::Rooted global(aCx, JS_GetGlobalForObject(aCx, aObject)); - nsCOMPtr window = - do_QueryInterface(nsJSUtils::GetStaticScriptGlobal(global)); - - if (window) { - nsresult rv; - nsCOMPtr permMgr = - do_GetService(NS_PERMISSIONMANAGER_CONTRACTID, &rv); - NS_ENSURE_SUCCESS(rv, false); - - uint32_t perm; - rv = permMgr->TestPermissionFromWindow( - window, "moz-extremely-unstable-and-will-change-webcomponents", &perm); - NS_ENSURE_SUCCESS(rv, false); - - return perm == nsIPermissionManager::ALLOW_ACTION; - } - - return false; + JS::Rooted obj(aCx, aObject); + return Preferences::GetBool("dom.webcomponents.enabled") || + IsInCertifiedApp(aCx, obj); } nsresult