Skip to content

Instantly share code, notes, and snippets.

@darkwing
Created September 18, 2012 17:23
Show Gist options
  • Save darkwing/3744439 to your computer and use it in GitHub Desktop.
Save darkwing/3744439 to your computer and use it in GitHub Desktop.
Mozilla Developer Network Search Bookmarklet
(function()%7Bvar%20d=document,w=window,ds=d.getSelection,ws=w.getSelection,ss=d.selection,e=encodeURIComponent;t=(ws)%3Fws():(ds)%3Fds():(ss)%3Fss.createRange().text:'';t=(t.toString().length)%3Ft:prompt('What term would you like to research?','');if(t)%7Ba='https://developer.mozilla.org/en-US/search?q=';u=a+e(t);f=function()%7Bx=w.open(u,'nfx','scrollbars=1,toolbar=0,resizable=1,status=1,width=600,height=600');if(!x)w.location.href=u;%7D;if(/Firefox/.test(navigator.userAgent))setTimeout(f,0);else%20f();%7D%7D)();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment