Bug 1175653 - followup review comments: remove URI_INHERITS_SECURITY_CONTEXT check, r=dveditz

--HG--
extra : commitid : 4wWlgYZR4SJ
This commit is contained in:
Gijs Kruitbosch 2015-07-03 16:00:21 +01:00
Родитель ac56089194
Коммит 4eb74802e9
1 изменённых файлов: 3 добавлений и 10 удалений

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

@ -43,9 +43,6 @@ const NS_BINDING_ABORTED = Components.results.NS_BINDING_ABORTED;
const NS_ERROR_WONT_HANDLE_CONTENT = 0x805d0001;
const NS_ERROR_ABORT = Components.results.NS_ERROR_ABORT;
const URI_INHERITS_SECURITY_CONTEXT = Components.interfaces.nsIHttpProtocolHandler
.URI_INHERITS_SECURITY_CONTEXT;
function shouldLoadURI(aURI) {
if (aURI && !aURI.schemeIs("chrome"))
return true;
@ -402,14 +399,10 @@ nsBrowserContentHandler.prototype = {
return localSchemes.has(uri.scheme);
};
if (isLocal(uri)) {
// only load URIs which do not inherit chrome privs
// If the URI is local, we are sure it won't wrongly inherit chrome privs
var features = "chrome,dialog=no,all" + this.getFeatures(cmdLine);
var netutil = Components.classes["@mozilla.org/network/util;1"]
.getService(nsINetUtil);
if (!netutil.URIChainHasFlags(uri, URI_INHERITS_SECURITY_CONTEXT)) {
openWindow(null, uri.spec, "_blank", features);
cmdLine.preventDefault = true;
}
openWindow(null, uri.spec, "_blank", features);
cmdLine.preventDefault = true;
} else {
dump("*** Preventing load of web URI as chrome\n");
dump(" If you're trying to load a webpage, do not pass --chrome.\n");