"bill" wrote
This is a question about defensive web browsing. Ocassionally I
run into a page whose JavaScript does something that I find obnoxious.
I would like to turn off JavaScript only for that page (instead of
disabling it globally). It would be cool if there were some way
to do this through a "bookmarkable" JavaScript snippet using the
javascript: pseudoprotocol. Does anyone know any trick to do any
of this?
The following bookmarklet code removes all scripts and all event
definitions, then reloads the cleaned up page:
javascript
:if(frames.length){alert('Sorry, doesn\'t work in
frames');}else{onerror=function(){return
true};while((es=document.getElementsByTagName('scr ipt')).length){es[0].paren
tNode.removeChild(es[0]);}es=document.all;for(i=0;i<es.length;++i){e=es[i];f
or(p in
e){if(!p.indexOf('on')&&e[p]){e[p]=null;}}}document.write(document.documentE
lement.outerHTML);document.close();onerror=functio n(){return true};}void 0;
HTH
Ivo