From 4eb74802e91afdea30dfe68f9476c7f6865b9b89 Mon Sep 17 00:00:00 2001 From: Gijs Kruitbosch Date: Fri, 3 Jul 2015 16:00:21 +0100 Subject: [PATCH] Bug 1175653 - followup review comments: remove URI_INHERITS_SECURITY_CONTEXT check, r=dveditz --HG-- extra : commitid : 4wWlgYZR4SJ --- browser/components/nsBrowserContentHandler.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/browser/components/nsBrowserContentHandler.js b/browser/components/nsBrowserContentHandler.js index c1a16cc882a6..55b247a5c588 100644 --- a/browser/components/nsBrowserContentHandler.js +++ b/browser/components/nsBrowserContentHandler.js @@ -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");