mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 03:47:57 +01:00
Fix :tabdo.
This commit is contained in:
@@ -571,8 +571,8 @@ const Tabs = Module("tabs", {
|
|||||||
commands.add(["tabd[o]", "bufd[o]"],
|
commands.add(["tabd[o]", "bufd[o]"],
|
||||||
"Execute a command in each tab",
|
"Execute a command in each tab",
|
||||||
function (args) {
|
function (args) {
|
||||||
for (let i = 0; i < tabs.count; i++) {
|
for (let tab in values(tabs.visibleTabs)) {
|
||||||
tabs.select(i);
|
tabs.select(tab);
|
||||||
if (!dactyl.execute(args[0] || "", null, true))
|
if (!dactyl.execute(args[0] || "", null, true))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ const Template = Module("Template", {
|
|||||||
let url = (frame.filename || "unknown").replace(/.* -> /, "");
|
let url = (frame.filename || "unknown").replace(/.* -> /, "");
|
||||||
function getPath(url) {
|
function getPath(url) {
|
||||||
try {
|
try {
|
||||||
return util.getFile(util.newURI(url)).path;
|
return util.getFile(url).path;
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
return url;
|
return url;
|
||||||
|
|||||||
@@ -470,6 +470,9 @@ const Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
|
|||||||
* @param {nsIURI} uri The URI for which to find a file.
|
* @param {nsIURI} uri The URI for which to find a file.
|
||||||
*/
|
*/
|
||||||
getFile: function getFile(uri) {
|
getFile: function getFile(uri) {
|
||||||
|
if (isString(uri))
|
||||||
|
uri = util.newURI(uri);
|
||||||
|
|
||||||
if (uri instanceof Ci.nsIFileURL)
|
if (uri instanceof Ci.nsIFileURL)
|
||||||
return File(uri.QueryInterface(Ci.nsIFileURL).file);
|
return File(uri.QueryInterface(Ci.nsIFileURL).file);
|
||||||
let channel = services.io.newChannelFromURI(uri);
|
let channel = services.io.newChannelFromURI(uri);
|
||||||
|
|||||||
Reference in New Issue
Block a user