Skip to content

Loading…

Does uBlock support on-the-fly JS modification before execution on pageload? #604

Closed
greatwolf opened this Issue · 5 comments

3 participants

@greatwolf

I've been scouring the interweb looking for a browser plugin that can do this, preferably for chrome.

Here's the scenario and use-case I'm looking to address: nowadays, website owners are catching on to the fact that more and more users are using adblockers on their sites. To combat this, many of them started using adblock detection techniques to try and get users to disable those addons.

Major of these detection techniques rely on running some form of inlined javascript on pageload. IMO, the most effective way to prevent this is to stop that piece of offending JS from ever running to begin with.

But to do this requires that the browser provides some way or mechanism for addons to intercept, evaluate and possibly modify HTML/JS content before it has a chance to run but after fetching the code from the webserver.

Is uBlock capable of supporting such a feature? For example, something that let's you match the innerHTML of a <script> tag using regex for some anti-adblocking pattern. On match, it can either modify that dom node to be harmless or just outright remove it altogether. Of course all this has to happen before that offending piece of JS ever gets a chance to run. Removing it after the fact would be pointless since whatever action that JS does has already been carried out.

@Deathamns

Read this (and other related articles in the Wiki).

@greatwolf

Thanks, checking that out now.

@gorhill

Is uBlock capable of supporting such a feature?

No. Nearest is the ability to block inline js.

@gorhill

There is no plan to support such a feature -- that's more a job for a proxy.

@gorhill gorhill closed this
@greatwolf

Thanks for response, am currently checking out Privoxy and Proxomitron though the later isn't updated anymore. Will still use uBlocker in combination.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.