Skip to content

Instantly share code, notes, and snippets.

@michaelfox
Created October 8, 2010 05:23
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 michaelfox/616394 to your computer and use it in GitHub Desktop.
Save michaelfox/616394 to your computer and use it in GitHub Desktop.
JavaScript to use Quix as a search engine in Google Chrome
javascript:Quix();function Quix()%7Bvar e=encodeURIComponent;var t=window.getSelection?window.getSelection():(document.getSelection?document.getSelection():(document.selection?document.selection.createRange().text:''));var c="%s";if(t!='')%7Bif(c)%7Bc+=' '+t}else%7Bc=''+t}}if(c)%7Bvar u='http://quixapp.com/go/?c='+e(c)+'&t='+(document.title?e(document.title):'')+'&s=http://github.com/michaelfox/Quix-Commands/raw/master/quix.txt'+'&v=080'+'&u='+(document.location?e(document.location):'');d=''+document.location;if(d.substr(0,4)!='http')%7Bwindow.location=u+'&mode=direct'}else%7Bheads=document.getElementsByTagName('head');if(c.substring(0,1)==' ')%7Bvar w=window.open(u+'&mode=direct');w.focus()}else if(heads.length==0)%7Bwindow.location=u+'&mode=direct'}else%7Bq=document.getElementById('quix');if(q)%7Bq.parentNode.removeChild(q)}sc=document.createElement('script');sc.src=u;sc.id='quix';sc.type='text/javascript';void(heads[0].appendChild(sc))}}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment