Skip to content

Instantly share code, notes, and snippets.

@norcross
Created September 19, 2012 16:41
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 norcross/3750680 to your computer and use it in GitHub Desktop.
Save norcross/3750680 to your computer and use it in GitHub Desktop.
Search highlighted term for coupon code
// paste the javascript string below into a browser bookmark (as the location)
// highlight the text on the page and a new tab or window will open searching
// with the highlighted text and the word 'coupon code'
// NOTE: apparently this only works in Firefox (for now, at least)
// Google
javascript:(function(){var%20text%20=%20window.content.getSelection().toString();window.open('http://www.google.com/search?q='+text+'%20coupon%20code');})();
// Bing
javascript:(function(){var%20text%20=%20window.content.getSelection().toString();window.open('http://www.bing.com/search?q='+text+'%20coupon%20code');})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment