-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Ability to select hostname in element picker when creating cosmetic filters #2035
Comments
uBO does not add |
I guess my question, is it possible to change the filter creation methodology when using element picker so it always strips the Edit: For example, a filter that uses |
Automatically stripping |
Thanks @gorhill for looking into it! I do agree about not wanting to strip all prefixes from a domain such as your That being said I can't think of any scenario where stripping If you figure out a solution, the same "issue" also applies to the dynamic 'My rules' tab when setting a block via the logger. I'm not sure if fixing the element picker ends up being the same "fix" for dynamic rules though, so it could be more difficult/not worth implementing depending on code issues. |
What happens if you strip |
Yes, that's actually the point I was actually trying to (clumsily) make -- what is good for |
@gwarser, from what I have seen, if there is a common element you are blocking that shows up on If for some reason there was an advertisement or element you wanted to block that was persistent on both I could see how it could be interpreted that it could potentially hamper sub domain performance if a element picker rule always ignored |
bbc.co.uk is the domain name, while co.uk is a TLD. bbc isn't a mere prefix here. |
This could be useful for some websites. Content is sometimes hosted on sub domains like b12.website.com where the prefix changes depending on what your viewing. I think Photobucket did this at one point. |
It's not worth it imo. |
This allows to bring in all the benefits of syntax highlighting and enhanced editing features in the element picker, like auto- completion, etc. This is also a necessary step to possibly solve the following issue: - #2035 Additionally, incrementally improved the behavior of uBO's custom CodeMirror static filtering syntax mode when double-clicking somewhere in a static extended filter: - on a class/id string will cause the whole class/id string to be selected, including the prepending `.`/`#`. - somewhere in a hostname/entity will cause all the labels from the cursor position to the right-most label to be selected (subject to change/fine-tune as per feedback of filter list maintainers). Related feedback: - uBlockOrigin/uBlock-issues#1134 (comment)
Read first: https://github.com/gorhill/uBlock/blob/master/CONTRIBUTING.md
Describe the issue
When creating a filter with the element picker, I have noticed that sometimes it automatically adds 'www.' to the filter, and some times it doesn't. If ublock adds the 'www.' to your filter then your filter only applies on the 'www.site.com' domain and not the higher level 'site.com' domain without the 'www.'.
I was wondering if it is possible to just always drop the 'www.' from the filter creation, I don't see any value in adding it as your filter now won't work on 'https://site.com' but will only work when your browser is on 'https://www.site.com'. However if the filter never has the 'www.' and is only for 'site.com' it will work in both instances depicted above. This would be similar to how ublock doesn't include the 'http://' and 'https://' prefixes when creating a filter.
Steps for anyone to reproduce the issue
[Removed irrelevant information --gorhill]
The text was updated successfully, but these errors were encountered: