Skip to content

Instantly share code, notes, and snippets.

@SamNazar
Last active March 18, 2016 21:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SamNazar/3f7acf255a380f4dc2ec to your computer and use it in GitHub Desktop.
Save SamNazar/3f7acf255a380f4dc2ec to your computer and use it in GitHub Desktop.
Chrome custom search engine for wine data for Bryan
//Bookmarklet form that searches for the current selection, opening 2 new windows (will trip popup-blocker)
javascript:(function(){search = document.getSelection().toString().split(" ").join("+"); window.open("http://www.cellartracker.com/list.asp?fInStock=0&Table=List&iUserOverride=0&szSearch=" + search); window.open("http://www.wine-searcher.com/find/" + search); })();
// chrome custom search engine, opens one new window/tab as well as assigning the current location
javascript:{search = "%s".split(" ").join("+"); window.open("http://www.cellartracker.com/list.asp?fInStock=0&Table=List&iUserOverride=0&szSearch=" + search); window.location.assign("http://www.wine-searcher.com/find/" + search); }
@SamNazar
Copy link
Author

You can replace the window.location.assign() with another window.open(), but you'll have to tell chrome's popup blocker to allow popups from newtab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment