Skip to content

Instantly share code, notes, and snippets.

@teramako
Created April 24, 2013 11:03
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 teramako/5451367 to your computer and use it in GitHub Desktop.
Save teramako/5451367 to your computer and use it in GitHub Desktop.
現タブが about:blank や about:newtab だったら、:tabopen でも現タブに開くモンキーパッチ
commands.get("tabopen").action = function (args) {
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 (buffer.URL === "about:blank" ||
buffer.URL === "about:newtab")
where = liberator.CURRENT_TAB;
if (args)
liberator.open(args, { where: where });
else
liberator.open("", { where: where });
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment