Bookmarklets for all

19 December 2002

This was a collection of bookmarklets. But in reality, I did not use them.

Site Data Google Related;void(0);void(0);void(0);void(0);void(0);void(0);void(0);q=location.href;void(location.href=“http://www.google.com/search?client=googlet&q=related:'+q))

Whois;%20p%20=%20h.length;%20if%20(h[p-1].match(/com|net|org|edu\/i))%20{%20location%20=%20’http://www.netsol.com/cgi-bin/whois/whois?SearchType=do&STRING="%20+%20h[p-]%20+%20'."%20+%20h[p-];%20}%20else%20{%20alert('This%20bookmarklet%20can%20only%20look%20up%20owners%20for%20.com,%20.net,%20.org,%20and%20.edu%20domains.');%20}%20void(0);%20})();)

Cookie}else{alert(“Cookie%20for%20this%20site:‘+document.cookie)}) Echo Form;void(c=(d.all)?d.all.tags(“form’):d.getElementsByTagName(“form’));with©{for(i=0;i<length;i++)%20item(i).setAttribute(‘action’,df);})
Validate Site
W3C HTML Validator)
W3C CSS Validator)

Selected Text Search Google.text);for(i=0;i<document.frames.length;%20++){q=document.frames[i].document.selection.createRange().text;if(q!=“)break;}if(q==”)void(q=prompt(‘Enter%20text%20to%20search%20using%20Google.%20You%20can%20also%20highlight%20a%20word%20on%20this%20web%20page%20before%20clicking%20Google%20Search.’,“));if(q)location.href=‘http://www.google.com/search?client=googlet&q='+escape(q))

Define{Term=top.document.frames[i].document.selection.createRange().text}}};if(!Term){void(Term=prompt(‘Dictionary%20Lookup:‘,“))}if(Term)void(window.open(‘http://www.m-w.com/cgi-bin/dictionary?'+escape(Term))))

Thesarus{Term=top.document.frames[i].document.selection.createRange().text}}};if(!Term){void(Term=prompt(‘Find%20Synonyms%20For:‘,“))}if(Term)void(window.open(‘http://www.m-w.com/cgi-bin/thesaurus?book=Thesaurus&va='+escape(Term))))

Grab%20{%20s%20=%20window.getSelection();%20if%20(s.rangeCount%20&&%20!s.getRangeAt(0).collapsed)%20{x%20=%20document.createElement(“div”);%20x.appendChild(s.getRangeAt(0).cloneContents());%20h=x.innerHTML;%20}%20}%20else%20{%20h%20=%20document.selection.createRange().htmlText%20}%20if(h)%20{%20d=window.open().document;%20d.write(“”+h+“”);%20d.close();%20}})())

Manipulate Page
Grayscale the page’;void(null))
Missing ALT Tags{if(di[i].getAttribute(‘ALT’).length==0)str+=di[i].src.link(di[i].src)+’”}if(str.length==0){alert(‘All%20images%20have%20ALTs!’)}else{W=open(“‘,’s’,“width=600,height=300,resizable,scrollbars’);with(W.document){write(”These%20images%20are%20missing%20ALTs:’+str);close()}}) Lose CSS)

Zoom +);if(z){s.setAttribute(‘zoom’,(parseInt(z)+50)+‘%’);}else%20s.setAttribute(‘zoom’,‘150%’);)

Zoom -);if(z){s.setAttribute(‘zoom’,(parseInt(z)-50)+‘%’);}else%20s.setAttribute(‘zoom’,‘50%’);)
Turn on Borders;void(d.g=d.getElementsByTagName);void(l=‘link’);void(H=d.g(‘head’).item(0));void(c=(d.all)?c=d.all.tags(l):d.g(l));with©%20{for(i=0;i0;i—){if(f/3==Math.ceil(f/3)){fs=fs.substring(0,%20i)+“,’fs.substring(i,fs.length);}f+;}alert(“This%20page%20weighs%20’fs”%20bytes.‘);) Show DIVs);for(i=0;i%20’document.images[i].src”%20’document.images[i].width”%20x%20’document.images[i].height”,%20’document.images[i].fileSize”%20Bytes

%0A

’};if(n!=“‘){document.write(’

%0An

%0A

”);void(document.close())}else{alert(‘i%20see%20no%20images’)}) Page Weight and Speed;element.setAttribute(“src’,“http://www.gazingus.org/js/pageWeight.js');document.body.appendChild(element)})())) Zap handlers{%20while%20(N[a])%20{%20Z[a]=Z[a]?Z[a]+1:1;%20N[a]=null;%20}%20}%20function%20zapEH(N)%20{%20var%20a,i,C;%20for%20(j%20in%20H)%20R(N,“on”H[j]);%20C=N.childNodes;%20for%20(i=0;i<C.length;i)%20zapEH(C[i]);%20}%20zapEH(document);%20for%20(j%20in%20Z)%20s%20=%20j%20+%20”%20(“%20+%20Z[j]%20+%20”)n”;%20if(s)%20alert(“Zapped%20event%20handlers:nn”+s);%20else%20alert(“No%20event%20handlers%20found.”);})();)

Misc

Resize