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

Custom "Allow Snippets" toggle for Adblock Plus #1528

Open
4 tasks done
Metrokoto opened this issue Oct 6, 2024 · 8 comments
Open
4 tasks done

Custom "Allow Snippets" toggle for Adblock Plus #1528

Metrokoto opened this issue Oct 6, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@Metrokoto
Copy link

Preliminary checklist

  • I have read the README
  • I have searched existing issues for my feature request. This is a new issue (NOT a duplicate) and is not related to another issue.
  • I have searched wont fix issues and this request is not among them
  • This is a feature request for the Cromite browser; not the website nor F-Droid nor anything else.

Is your feature request related to privacy?

Yes

Is there a patch available for this feature somewhere?

It should be possible to patch the Adblock Plus code itself to achieve this

Describe the solution you would like

Considering the lack of extension support for the Android version of Cromite (we can only block ads with Adblock Plus), I believe it is essential to be able to allow scriptlet rules for third party lists that we trust.

For example, I use BadBlock by @celenityy as well as Ad-Void by @igorskyflyer in my custom lists, one of which, Ad-Void, has various scriptlet rules that would be overall beneficial to enhance ABP's blocking capabilities.

See:

https://raw.githubusercontent.com/the-advoid/ad-void/refs/heads/main/scriptlets/AdVoid.Scriptlets.AntiAntiAdBlock.txt

Additionally, AdGuard and uBlock already allow third party lists to define scriptlet rules, and uBlock also has a toggle to allow "custom rules requiring trust", so ABP is behind them in terms of capabilities currently.

TLDR: I think it would be beneficial to add a submenu to the scriptlets toggle to allow third party URLs to add scriptlet rules.

Describe alternatives you have considered

Not possible

@uazo
Copy link
Owner

uazo commented Oct 7, 2024

interesting but lacking an explanation of why those rules are needed and what they deactivate.

@uazo uazo added the enhancement New feature or request label Oct 7, 2024
@Metrokoto
Copy link
Author

interesting but lacking an explanation of why those rules are needed and what they deactivate.

Allow me to point you to some relevant documentation!

https://help.adblockplus.org/hc/en-us/articles/1500002338501-Snippet-filters-tutorial

https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#scriptlet-injection

@uazo
Copy link
Owner

uazo commented Oct 7, 2024

sorry, perhaps I have not made myself clear.
I know what the snippets are for, I would like to know what every single instruction I see in the rule is for and possibly some urls to test them.

@Metrokoto
Copy link
Author

Metrokoto commented Oct 7, 2024

sorry, perhaps I have not made myself clear. I know what the snippets are for, I would like to know what every single instruction I see in the rule is for and possibly some urls to test them.

For that, you would be best speaking to @igorskyflyer, but from what I understand, they are rules specifically designed to fight more advanced anti-adblock systems.

Also, this feature request isn't just about these specific snippet rules, but rather, the wider scope of them in general. A lot of paywall bypassing filterlists use them, as well as anti-cookie banner lists. They have become somewhat necessary nowadays for most things. uBlock's uAssets lists are full of ++js rules.

TLDR; I am suggesting we globally enable snippets but allow user control of what lists can use them as a middle ground between security, usability, and privacy, as uBlock allows them, AdGuard allows them, so I don't see what is stopping us.

@uazo
Copy link
Owner

uazo commented Oct 9, 2024

they are rules specifically designed to fight more advanced anti-adblock systems.

I don't completely disagree with the feasibility of leaving the choice up to the user, but I would first like to understand whether it would be appropriate to activate those filters by default for everyone, since use would allow the page to understand the presence of the list.
and to understand it I would at least have to know what those rules are for.

@igorskyflyer
Copy link

igorskyflyer commented Oct 10, 2024

sorry, perhaps I have not made myself clear. I know what the snippets are for, I would like to know what every single instruction I see in the rule is for and possibly some urls to test them.

Hello, I am the mentioned author of the given scriptlets.
In a nutshell, scriplets provide more advanced ways of blocking/hiding ads/annoyances by injecting JavaScript code into a given page, see more here. Scriplets can dismiss dialogs, accept/reject cookies, stop popup windows, rewrite URLs and many, many useful and powerful things more that are just not possible using just the filters.

The provided scriptlets block those anti-Adblock popups that block the user completely from using the site without disabling their Adblocker, i.e.:

Figure 1. Anti-Adblock popup


Note

The mentioned scriptlets are global (apply to any site), there are also site-specific ones, for reference: AdVoid.Core.Scriptlets and AdVoid.Addon.NoAnnoyances.Scriptlets.


Hope that this clears it why it's important to add them as a feature (if possible). If you have any more questions, feel free to ask.


Additional references:

@celenityy
Copy link

I can understand the usefulness of having snippets, but being able to inject JS does seem to have some valid privacy & security concerns.

Personally, I think an ideal solution here could maybe be to:

  • Disable snippets for all lists by default
  • Allow users to toggle snippets per list for users who desire the stronger blocking (Ex. I could grant List A permission to use snippets, without allowing List B, List C, & so on).

@uazo
Copy link
Owner

uazo commented Oct 10, 2024

there are also site-specific ones, for reference: AdVoid.Core.Scriptlets and AdVoid.Addon.NoAnnoyances.Scriptlets.

@igorskyflyer thank you, that's what I was looking for.

Scriplets can dismiss dialogs, accept/reject cookies, stop popup windows, rewrite URLs and many, many useful and powerful things more that are just not possible using just the filters.

yes, but not everything is allowed in cromite.
modification of the csp is not permitted by scriptlets, for example.

Disable snippets for all lists by default

@celenityy is already like that.

Allow users to toggle snippets per list for users who desire the stronger blocking

I would prefer to have default lists for all users (like your work in #1245, by the way, excuse me, but I did not forget).

but being able to inject JS does seem to have some valid privacy & security concerns.

exactly. and not only that, all changes made in javascript are a source for fingerprinting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants