Nixing Javascript via javascript: pseudoproto?

B

bill

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?

Many thanks!

-bill
 
I

Ivo

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('script')).length){es[0].paren
tNode.removeChild(es[0]);}es=document.all;for(i=0;i<es.length;++i){e=es;f
or(p in
e){if(!p.indexOf('on')&&e[p]){e[p]=null;}}}document.write(document.documentE
lement.outerHTML);document.close();onerror=function(){return true};}void 0;

HTH
Ivo
 
B

bill

In said:
"bill" wrote
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('script')).length){es[0].paren
tNode.removeChild(es[0]);}es=document.all;for(i=0;i<es.length;++i){e=es;f
or(p in
e){if(!p.indexOf('on')&&e[p]){e[p]=null;}}}document.write(document.documentE
lement.outerHTML);document.close();onerror=function(){return true};}void 0;


Way cool! Very handy.

Thanks!

-bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top