djr33
11-26-2010, 05:29 AM
I had an idea for a JS bookmarklet: something to disable all JS on a page.
The reason would be to stop unexpected things from happening, especially ads with sound. I'm talking about rotating ads, not just static flash ads.
This might be useful for other reasons as well.
In PHP, $GLOBALS contains all of the active variables-- everything. By looping through the array, you could remove all of this and effectively disable most things.
My knowledge of JS isn't strong enough to find an equivalent (perhaps window. or document.?), but if someone has an idea that would work to disable all active processes, that would be great. I imagine that looping functions would cause more trouble than just unsetting all variables, but perhaps there's a way.
Or, alternatively is there any code that is guaranteed to crash JS? Or make it pause (like sleep() in PHP)?
Just attach this to a bookmarklet and it would probably be very popular.
The reason would be to stop unexpected things from happening, especially ads with sound. I'm talking about rotating ads, not just static flash ads.
This might be useful for other reasons as well.
In PHP, $GLOBALS contains all of the active variables-- everything. By looping through the array, you could remove all of this and effectively disable most things.
My knowledge of JS isn't strong enough to find an equivalent (perhaps window. or document.?), but if someone has an idea that would work to disable all active processes, that would be great. I imagine that looping functions would cause more trouble than just unsetting all variables, but perhaps there's a way.
Or, alternatively is there any code that is guaranteed to crash JS? Or make it pause (like sleep() in PHP)?
Just attach this to a bookmarklet and it would probably be very popular.