Skip to content

Instantly share code, notes, and snippets.

@anekos
Created February 12, 2011 20:14
Show Gist options
  • Save anekos/824073 to your computer and use it in GitHub Desktop.
Save anekos/824073 to your computer and use it in GitHub Desktop.
回答
commands.addUserCommand(
['sitesearch'],
'Search in this site',
function (args) {
liberator.open(
'http://www.google.com/search?q=' +
encodeURIComponent(args.literalArg) +
'+site%3A' +
window.content.location.hostname,
liberator.NEW_TAB
);
},
{
completer: function (context) completion.url(context, 'S'),
literal: 0,
},
true
);
mappings.addUserMap(
[modes.NORMAL],
['ss'],
'Search in this site',
function() commandline.open(':', 'sitesearch ', modes.EX)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment