Created
January 15, 2009 21:28
-
-
Save netsuke/47637 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Google site search ubiquity command | |
//Search the current webpage using google site search | |
CmdUtils.CreateCommand({ | |
name: "google-site-search", | |
icon: "http://www.google.com/favicon.ico", | |
author: { name: "Nanya Bizuidenhoud", email: "netsuke87@yahoo.com"}, | |
description: "Search the current website for the given keyword using google site search", | |
help: "Simply type google-site-search in the ubiquity command interface, input the keyword to search for and the website you are looking at will be searched using google site search for the specified keyword", | |
takes: {"keyword": noun_arb_text}, | |
preview: function( pblock, searchTerm) { | |
pblock.innerHTML = "Searches current site for: " + searchTerm.text; | |
}, | |
execute: function(keyword) { | |
var url = context.focusedWindow.document.URL; | |
var search="http://www.google.com/search?sitesearch="+url+"&as_q="+keyword.text+"&x=0&y=0" | |
Utils.openUrlInBrowser(search); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment