mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 18:47:59 +01:00
Fix :tab extp.
This commit is contained in:
@@ -1604,6 +1604,7 @@ const Dactyl = Module("dactyl", {
|
||||
commands.add(["exto[ptions]", "extp[references]"],
|
||||
"Open an extension's preference dialog",
|
||||
function (args) {
|
||||
let tab = dactyl.forceNewTab;
|
||||
AddonManager.getAddonsByTypes(["extension"], function (list) {
|
||||
list = list.filter(function (extension) extension.name == args[0]);
|
||||
if (!list.length || !list[0].optionsURL)
|
||||
@@ -1611,7 +1612,7 @@ const Dactyl = Module("dactyl", {
|
||||
else if (args.bang)
|
||||
window.openDialog(list[0].optionsURL, "_blank", "chrome");
|
||||
else
|
||||
dactyl.open(list[0].optionsURL, { from: "extoptions" });
|
||||
dactyl.open(list[0].optionsURL, { from: "extoptions", where: tab && dactyl.NEW_TAB });
|
||||
});
|
||||
}, {
|
||||
argCount: "1",
|
||||
|
||||
@@ -590,9 +590,14 @@ const Tabs = Module("tabs", {
|
||||
commands.add(["tab"],
|
||||
"Execute a command and tell it to output in a new tab",
|
||||
function (args) {
|
||||
dactyl.forceNewTab = true;
|
||||
dactyl.execute(args[0], null, true);
|
||||
dactyl.forceNewTab = false;
|
||||
try {
|
||||
var force = dactyl.forceNewTab;
|
||||
dactyl.forceNewTab = true;
|
||||
dactyl.execute(args[0], null, true);
|
||||
}
|
||||
finally {
|
||||
dactyl.forceNewTab = force;
|
||||
}
|
||||
}, {
|
||||
argCount: "+",
|
||||
completer: function (context) completion.ex(context),
|
||||
|
||||
Reference in New Issue
Block a user