Skip to content

Instantly share code, notes, and snippets.

@anekos
Created April 16, 2014 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anekos/10884861 to your computer and use it in GitHub Desktop.
Save anekos/10884861 to your computer and use it in GitHub Desktop.
Open one or more URLs in a new background tab
js << EOM
commands.add(
["backgroundtabopen", "bt[open]", "btabnew"],
"Open one or more URLs in a new background tab",
function (args) {
let index = tabs.getTab();
let special = args.bang;
args = args.string;
if (options.get("activate").has("all", "tabopen"))
special = !special;
let where = special ? liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB;
if (args)
liberator.open(args, { where: where });
else
liberator.open("", { where: where });
tabs.selectAlternateTab();
}, {
bang: true,
completer: function (context) completion.url(context),
literal: 0,
privateData: true
}
);
EOM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment