Bug 412434 - opening a window with -chrome broken by bug 395942, p=arno.@no-log.org (arno.), r=mscott

git-svn-id: svn://10.0.0.236/trunk@243186 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
philringnalda%gmail.com
2008-01-16 05:27:42 +00:00
parent 715ed125fa
commit e363b58633

View File

@@ -43,6 +43,7 @@ const nsICommandLineHandler = Components.interfaces.nsICommandLineHandler;
const nsICommandLineValidator = Components.interfaces.nsICommandLineValidator;
const nsIDOMWindowInternal = Components.interfaces.nsIDOMWindowInternal;
const nsIFactory = Components.interfaces.nsIFactory;
const nsIFileURL = Components.interfaces.nsIFileURL;
const nsINetUtil = Components.interfaces.nsINetUtil;
const nsISupportsString = Components.interfaces.nsISupportsString;
const nsIURILoader = Components.interfaces.nsIURILoader;
@@ -54,6 +55,37 @@ const NS_ERROR_ABORT = Components.results.NS_ERROR_ABORT;
const URI_INHERITS_SECURITY_CONTEXT = Components.interfaces.nsIProtocolHandler
.URI_INHERITS_SECURITY_CONTEXT;
function resolveURIInternal(aCmdLine, aArgument) {
var uri = aCmdLine.resolveURI(aArgument);
if (!(uri instanceof nsIFileURL)) {
return uri;
}
try {
if (uri.file.exists())
return uri;
}
catch (e) {
Components.utils.reportError(e);
}
// We have interpreted the argument as a relative file URI, but the file
// doesn't exist. Try URI fixup heuristics: see bug 290782.
try {
var urifixup = Components.classes["@mozilla.org/docshell/urifixup;1"]
.getService(nsIURIFixup);
uri = urifixup.createFixupURI(aArgument, 0);
}
catch (e) {
Components.utils.reportError(e);
}
return uri;
}
function mayOpenURI(uri)
{
var ext = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]