"Search in Google" Bookmarklet

Discussion in 'iOS Apps' started by screensaver400, Sep 20, 2014.

  1. screensaver400 macrumors 6502a

    Joined:
    Jan 28, 2005
    #1
    I changed my default search engine in Safari to DuckDuckGo, but occasionally I get poor results and want to try the search in Google.

    Sure, I could type Google.com into the location bar, but who wants to do that?

    Does anyone know of a a bookmarklet that parses the current DuckDuckGo search from the URL, and shoots you to a Google results page for the same search? I can't imagine it would be tough to whip up, but I'm not a developer.
     
  2. screensaver400 thread starter macrumors 6502a

    Joined:
    Jan 28, 2005
    #2
    Found one.

    Code:
    javascript:Q=[];%20c=location.search.slice(1).split('&');%20for%20(i%20in%20c)%20{%20f=c[i].split('=');%20if%20(f[0]=='q'%20||%20f[0]=='as_q'%20||%20f[0]=='p'%20||%20f[0]=='query')%20if%20(f[1])%20Q.push(f[1])%20}%20R=unescape(Q.join(';%20').replace(/\+/g,'%20'));%20location%20=%20'http://google.com/search?query='%20+%20escape(R);
     

Share This Page