Bug 1570212 - Convert dom.allow_XUL_XBL_for_file to a static pref. r=mccr8

Differential Revision: https://phabricator.services.mozilla.com/D40153
This commit is contained in:
Nicholas Nethercote
2019-08-02 11:59:04 +00:00
parent 6006d676ab
commit f548590e7c
3 changed files with 7 additions and 6 deletions

View File

@@ -307,7 +307,6 @@ uint32_t nsContentUtils::sRunnersCountAtFirstBlocker = 0;
nsIInterfaceRequestor* nsContentUtils::sSameOriginChecker = nullptr;
bool nsContentUtils::sIsHandlingKeyBoardEvent = false;
bool nsContentUtils::sAllowXULXBL_for_file = false;
nsString* nsContentUtils::sShiftText = nullptr;
nsString* nsContentUtils::sControlText = nullptr;
@@ -621,9 +620,6 @@ nsresult nsContentUtils::Init() {
sBlockedScriptRunners = new AutoTArray<nsCOMPtr<nsIRunnable>, 8>;
Preferences::AddBoolVarCache(&sAllowXULXBL_for_file,
"dom.allow_XUL_XBL_for_file");
#ifndef RELEASE_OR_BETA
sBypassCSSOMOriginCheck = getenv("MOZ_BYPASS_CSSOM_ORIGIN_CHECK");
#endif
@@ -6235,7 +6231,8 @@ bool nsContentUtils::AllowXULXBLForPrincipal(nsIPrincipal* aPrincipal) {
aPrincipal->GetURI(getter_AddRefs(princURI));
return princURI &&
((sAllowXULXBL_for_file && SchemeIs(princURI, "file")) ||
((StaticPrefs::dom_allow_XUL_XBL_for_file() &&
SchemeIs(princURI, "file")) ||
IsSitePermAllow(aPrincipal, NS_LITERAL_CSTRING("allowXULXBL")));
}