ADBlock is blocking some content on the site

ADBlock errore

Firefox addon to customize which JS functions are [en|dis]abled for a particular URL

StackOverflow https://stackoverflow.com/questions/13215564


I would like to know if it is possible to write a FF plugin which will, once a certain page is loaded, produce a listing of all the JS functions and give the user the option to disable or keep enabled a certain function.

I got the idea for this from FB. I have been getting quite irate by the FB news feed self refreshing while I am in the middle of reading or commenting on something and then it gets pushed down the screen and I can't find it cause my feed is like 2 mi long.

However, I do not want to completely turn JS off. I want to be able to set which are welcome functions and which are not. Self refresh and disabling back action are, in my book, the rudest JS functions for any site that irritate the c**p out of me.

Such envisioned plugin would then save the preferences for the particular URL so they would be loaded upon revisit, much like a cookie.

However, if there is something like this already, that would be awesome and I wouldn't have to reinvent the wheel.

No correct solution


With all the sophisticated JS Frameworks and Libraries in use these days, your plan would fail in every except the most basic use cases.

Disabling a function you are not completely aware of what it does, will have strange consequences. This gets even harder because many functions return values when they are completed. So subsequent code may break or not execute correctly.

You simply cannot tell if the JS Code is flexible enough to handle an interrupted function or what consequences are connected with this intervention.

In your special facebook use case it may be enough to simply disable XHR-Requests. I noticed that the "pull"-request is connected with newsfeed refresh. You could write a GreaseMonkey script that overwrites the native XHR object a while after initiation:

setTimeout( function() {
    XMLHttpRequest = function(){}
    XMLHttpRequest.prototype = {
        open: function(){},
            send: function(){}
}, 5000);

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow