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 regexp support for $domain modifier #1550

Closed
slavaleleka opened this issue Nov 11, 2021 · 5 comments
Closed

Add regexp support for $domain modifier #1550

slavaleleka opened this issue Nov 11, 2021 · 5 comments

Comments

@slavaleleka
Copy link

now there is no chance to create single cosmetic rule for hiding the same element on such domains:
example1.com, example2.com, example3.org

it would be nice if $domain modifier supports regular expressions, just like $path does

something like this:
[$domain=/example[0-9]\.(com|org)/]##.ad

@ameshkov
Copy link
Member

Why limit just to the cosmetic rules? If we do it here, we should extend it to basic rules as well.

@sfionov can we include this in v1.10 for instance?

@sfionov
Copy link
Member

sfionov commented Nov 12, 2021

Yes, assigned to 1.10

@slavaleleka slavaleleka changed the title Add regexp support for $domain modifier for cosmetic rule Add regexp support for $domain modifier Nov 12, 2021
@Alex-302
Copy link
Member

Another one example
AdguardTeam/AdguardFilters#121186 (comment)
domains changed every day.

@dnmTX
Copy link

dnmTX commented May 18, 2023

@AdguardTeam maybe unrelated question but what about redirects? For example links from voe.sx are allways redirected to another domain and they change those domains very frequently. Here is a example:
Original Link: https://voe.sx/ffgecklhux79 redirects(as of now) to: https://tubelessceliolymph.com/ffgecklhux79
So basically rules that are applied for voe.sx simply don't work. And domains like tubelessceliolymph.com are disposable and replaced every week or so and user(s) like me have to reapply the same rules to the new domain.
Any workaournd(s) for this?

@krystian3w
Copy link

krystian3w commented May 18, 2023

uBo implemented regex, if someone trust something like:

/bad-js.$domain=/[a-z-]{18}\.[\w]{2,20}/
/[a-z-]{18}\.[\w]{2,20}/##.bad-class
!
! regex in the dumb version - rather, the webmaster fell how to avoid falling into a safe regex.

but fail for , in cosmetic/scriptlet filters and | in network filters if gorhill rejected repair:

uBlockOrigin/uBlock-issues#2234 (comment)


In theory, network filtering can be unprotected by domain=/from= and cosmetic filtering can be based on the site's permanent DOM tree (No match to 99.9% of the rest of the sites on the Internet).

The scriptlet is also still possible to run all over the Internet in uBo, but there have been considerations for years whether to secure this with a minimum of "I am an advanced user" activation.


Also voe is covered sometimes: uBlockOrigin/uAssets@5a660a9

(Unfortunately, I don't see how to turn these 36 domains into which regex - The site appears to have no fixed pattern (diffrent words, number order))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants