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