Backed out changeset 430ebb28dd92 (bug 935753) for mochitest-bc failures.

This commit is contained in:
Ryan VanderMeulen 2013-11-19 13:13:06 -05:00
parent 4374b8a99b
commit 2c5a2017f7

View File

@ -6338,21 +6338,14 @@ var gIdentityHandler = {
let nsIWebProgressListener = Ci.nsIWebProgressListener;
// For some URIs like data: we can't get a host and so can't do
// anything useful here.
// anything useful here. Chrome URIs however get special treatment.
let unknown = false;
try {
uri.host;
} catch (e) { unknown = true; }
// Chrome URIs however get special treatment. Some chrome URIs are
// whitelisted to provide a positive security signal to the user.
let chromeWhitelist = ["about:addons", "about:app-manager", "about:config",
"about:crashes", "about:healthreport", "about:home",
"about:newaddon", "about:permissions", "about:preferences",
"about:privatebrowsing", "about:sessionstore",
"about:support", "about:welcomeback"];
let lowercaseSpec = uri.spec.toLowerCase();
if (chromeWhitelist.some(function(whitelistedSpec) lowercaseSpec.startsWith(whitelistedSpec))) {
if ((uri.scheme == "chrome" || uri.scheme == "about") &&
uri.spec !== "about:blank") {
this.setMode(this.IDENTITY_MODE_CHROMEUI);
} else if (unknown) {
this.setMode(this.IDENTITY_MODE_UNKNOWN);