1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 07:24:13 +01:00

Completion of certain chrome:, resource:, and about: URLs.

This commit is contained in:
Kris Maglione
2010-12-14 23:05:41 -05:00
parent 50e47b9b2f
commit 0dcf1d8ffd
9 changed files with 118 additions and 41 deletions

View File

@@ -471,7 +471,12 @@ const Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
*/
getFile: function getFile(uri) {
if (isString(uri))
uri = util.newURI(uri);
try {
uri = util.newURI(uri);
}
catch (e) {
return null;
}
if (uri instanceof Ci.nsIFileURL)
return File(uri.QueryInterface(Ci.nsIFileURL).file);