Jake.codes

Re-Search in DuckDuckGo, JavaScript Bookmarklet

Friday, January 24, 2014

Sometimes I accidentally search in one of those other search engines, but with this it will redo the current query in the proper search engine, DuckDuckGo.

Bookmarklet

javascript:location.href='https://duckduckgo.com/'+location.href.match(/(\?|\&)(q|p)=.+/g)[0].replace('?p','?q');

Bookmarklet Source

location.href='https://duckduckgo.com/'+location.href.match(/(\?|\&)(q|p)=.+/g)[0].replace('?p','?q');