Backed out changeset a6e2d96c1274 (bug 1322565) for eslint failure

This commit is contained in:
Carsten "Tomcat" Book 2016-12-16 16:41:22 +01:00
Родитель 9f96024af4
Коммит 09ad3f43ec
2 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -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);