1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 16:34:14 +01:00

Fix :tabdo.

This commit is contained in:
Kris Maglione
2010-12-12 20:18:14 -05:00
parent beae274efb
commit 561b6e8e3b
3 changed files with 6 additions and 3 deletions

View File

@@ -225,7 +225,7 @@ const Template = Module("Template", {
let url = (frame.filename || "unknown").replace(/.* -> /, "");
function getPath(url) {
try {
return util.getFile(util.newURI(url)).path;
return util.getFile(url).path;
}
catch (e) {
return url;

View File

@@ -470,6 +470,9 @@ const Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
* @param {nsIURI} uri The URI for which to find a file.
*/
getFile: function getFile(uri) {
if (isString(uri))
uri = util.newURI(uri);
if (uri instanceof Ci.nsIFileURL)
return File(uri.QueryInterface(Ci.nsIFileURL).file);
let channel = services.io.newChannelFromURI(uri);