mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 16:32:59 +00:00
Backed out changeset a6e2d96c1274 (bug 1322565) for eslint failure
This commit is contained in:
parent
9f96024af4
commit
09ad3f43ec
@ -754,6 +754,9 @@ pref("gecko.handlerService.schemes.ircs.2.uriTemplate", "chrome://browser-region
|
||||
pref("gecko.handlerService.schemes.ircs.3.name", "chrome://browser-region/locale/region.properties");
|
||||
pref("gecko.handlerService.schemes.ircs.3.uriTemplate", "chrome://browser-region/locale/region.properties");
|
||||
|
||||
// By default, we don't want protocol/content handlers to be registered from a different host, see bug 402287
|
||||
pref("gecko.handlerService.allowRegisterFromDifferentHost", false);
|
||||
|
||||
pref("browser.geolocation.warning.infoURL", "https://www.mozilla.org/%LOCALE%/firefox/geolocation/");
|
||||
|
||||
pref("browser.EULA.version", 3);
|
||||
|
@ -30,6 +30,7 @@ const PREF_SELECTED_WEB = "browser.feeds.handlers.webservice";
|
||||
const PREF_SELECTED_ACTION = "browser.feeds.handler";
|
||||
const PREF_SELECTED_READER = "browser.feeds.handler.default";
|
||||
const PREF_HANDLER_EXTERNAL_PREFIX = "network.protocol-handler.external";
|
||||
const PREF_ALLOW_DIFFERENT_HOST = "gecko.handlerService.allowRegisterFromDifferentHost";
|
||||
|
||||
const STRING_BUNDLE_URI = "chrome://browser/locale/feeds/subscribe.properties";
|
||||
|
||||
@ -157,8 +158,9 @@ const Utils = {
|
||||
// We also reject handlers registered from a different host (see bug 402287)
|
||||
// The pref allows us to test the feature
|
||||
let pb = Services.prefs;
|
||||
if (!["http:", "https:"].includes(aContentWindow.location.protocol) ||
|
||||
aContentWindow.location.hostname != uri.host) {
|
||||
if (!pb.getBoolPref(PREF_ALLOW_DIFFERENT_HOST) &&
|
||||
(!["http:", "https:"].includes(aContentWindow.location.protocol) ||
|
||||
aContentWindow.location.hostname != uri.host)) {
|
||||
throw this.getSecurityError(
|
||||
"Permission denied to add " + uri.spec + " as a content or protocol handler",
|
||||
aContentWindow);
|
||||
|
Loading…
Reference in New Issue
Block a user