Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use "Scriptlet injection" in uBlock Origin #3

Closed
Nomes77 opened this issue Apr 27, 2021 · 4 comments
Closed

How to use "Scriptlet injection" in uBlock Origin #3

Nomes77 opened this issue Apr 27, 2021 · 4 comments

Comments

@Nomes77
Copy link
Owner

Nomes77 commented Apr 27, 2021

If someone sees this issues.

I wanted to learned to add Scriptlet injection in/to uBlock.
How do I know what to add?
Where have I to look?

For instance: On spele.nl there is an anti-adblock. How can I solve that?

@Nomes77 Nomes77 added the help wanted! Extra attention or help is needed label Apr 27, 2021
@Nomes77 Nomes77 pinned this issue Apr 27, 2021
@okiehsch
Copy link

okiehsch commented Apr 28, 2021

How do I know what to add?

That's not easy to answer, it depends. ;)
For a start read https://github.com/gorhill/uBlock/wiki/Resources-Library to look at what each injection does and how it basically works.
In most cases you will have to look at the source to see what function you want to disable.
Your example spele.nl is a little bit more complicated.
The site checks if improvedigital.com/pbw/headerlift.min.js has been loaded succesfully, if it concludes that it is blocked it will show the anti adblock message.
You can use a redirection to "trick" the site into believing that the targeted request has not been blocked.

@okiehsch
Copy link

Forgot to post the redirection.
||improvedigital.com/*/headerlift.min.js$script,redirect-rule=noop.js,domain=spele.nl
works on my end.

@okiehsch
Copy link

okiehsch commented Apr 28, 2021

For a rather straightforward example of how to fix an issue using an injection look at
uBlockOrigin/uAssets#8969

If you go to the source of that site view-source:https://getpaste.link/
you see
image

The adblock message is shown if the property "isAdBlockActive" has the value "true".
I added the filter getpaste.link##+js(set, isAdBlockActive, false) to change the value and the anti adblock issue is fixed.

@Nomes77
Copy link
Owner Author

Nomes77 commented Apr 28, 2021

@okiehsch Thanks for explaining.
I already looked at https://github.com/gorhill/uBlock/wiki/Resources-Library but didn't how where to look.
Thanks for letting me know you have to look in view-source:

@Nomes77 Nomes77 closed this as completed Apr 28, 2021
@Nomes77 Nomes77 unpinned this issue Apr 28, 2021
@Nomes77 Nomes77 removed the help wanted! Extra attention or help is needed label Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants