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

Add support for highlighting $document,domain= uBO modifier #26

Closed
ameshkov opened this issue May 16, 2019 · 5 comments
Closed

Add support for highlighting $document,domain= uBO modifier #26

ameshkov opened this issue May 16, 2019 · 5 comments
Labels
bug Something isn't working

Comments

@ameshkov
Copy link
Member

ameshkov commented May 16, 2019

Highlighting does not work for rules like this in the current version:
||parajumpersnettbutikk.com^$document,domain=~ Advarselen vises grunnet: En grovt falsk nettbutikksvindel som er svartelistet av Forbrukertilsynet.

@ameshkov ameshkov added the bug Something isn't working label May 16, 2019
@ameshkov ameshkov changed the title Add support for $document,domain= uBO modifier Add support for highlighting $document,domain= uBO modifier May 16, 2019
@ameshkov
Copy link
Member Author

@DandelionSprout I found it in your filter list, but I cannot find the formal modifier description. Could you please point me to a place where I can read about it?

@DandelionSprout
Copy link
Member

DandelionSprout commented May 16, 2019

The use of $domain~ [normal text comment] was a very quirky loophole I devised for uBO users, so that if a page warning was triggered for uBO users, it would show the text comment as a part of the page warning. I presumed that a lot of laymen didn't ever look up the source lists to look for comments for why a page was blocked, so I figured that I should bring the comments to them instead.

As for using $document for page blocking instead of page whitelisting, I believe it is currently a uBO- and Nano-only feature, with documentation for it at https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#document. Although it claims to not be necessary, I've found it to be necessary for subdomains that does not host blocked files on them, e.g. ||youtube.com/tv^$document.

If you meant something else than those two things, feel free to specify your question further.

@ameshkov
Copy link
Member Author

@DandelionSprout ha, this is smart:)

@ameshkov
Copy link
Member Author

ameshkov commented May 16, 2019

@gorhill check this out, please. What do you think about making it legal for filters maintainers to specify the reason for strict blocking?

For instance, in AG I'd like to do the following:

  1. Save comment lines which precede the rule
  2. Print them on the "request blocked" page and in the requests log.

Example:

! This is a tricky rule that needs some explanation
! The explanation can take more than one line
||example.org^

@DandelionSprout
Copy link
Member

DandelionSprout commented May 16, 2019

When writing e.g. ||example.com # Comment into Nano Adblocker's My Filters (as Nano tries to list broad explanations when an entry has been miswritten, which uBO does not), it claims that in-entry comments have been deprecated, so there must've been a conscious decision taken by gorhill (or possibly Jspenguin) at some point in time.

Edit: Nevermind this GitHub comment; I had misread your question to gorhill and originally thought you asked him about in-entry comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants