Custom filter: help please
I would like to add two universal cookie notification filter rules for Google in my custom list.
1.) Here is one for Google Translate: ###gb > .gb_[id]
2.) And here is one for Google Maps: ###pushdown > .gb_[id]
It looks like the first 4 characters are always the same (.gb_). Others change, for example:
translate.google.com###gb > .gb_X.gb_wa.gb_Jb (for Google Translate)
translate.google.com###gb > .gb_d.gb_2b.gb_Dc
www.google.com###pushdown > .gb_g.gb_8b.gb_Nc (for Google Maps)
Problem: the upper two universal rules do not work. Cookie notifications are still appearing.
I have also tried ###gb > [id^=".gb"] and ###pushdown > [id^=".gb"] but they don't seem to work neither. Did I write something wrong?
the upper two universal rules do not work
Because .gb_[id] matches nothing, your CSS rule is improperly crafted given what you want to accomplish.
Try translate.google.com###gb > [class^="gb_"].
Also, take note that the issue tracker here is only for issues with uBlock Origin, it should not be used as a help desk. I will have to become more hardcore if my goodwill to help keeps being abused through the opening of non-issues on GitHub -- each time I help someone with such non-issue, it sends the message to others that they can also do so, and this end up polluting the issue trackers here with things unrelated to uBlock. There are other places for such help, try Reddit, Wilders Security, anywhere else really.
Thank you for information. I didn't know for Wilders Securtiy forum. I will contact them (or Reddit) in the future.
Another trick useful in your case: use the element picker to validate whether a cosmetic filter works or not: uBlock will highlight whatever on the page matches the filter in the text field. So if you cut and paste ###gb > .gb_[id] in the text field of the element picker while on the page https://translate.google.com, uBlock would have highlighted nothing, meaning your cosmetic filter was not working. Entering ###gb > [class^="gb_"] would have highlighted the element you were trying to remove (and maybe other things on the page -- I did not try it).
Great! I thought the text field didn't have option to manually enter and test different rule variations. Very useful indeed.
Just in case, do not enter the prefix for the site when you test for a filter (i.e. translate.google.com), uBlock will always use the current site internally. In short:
###gb > [class^="gb_"]= goodtranslate.google.com###gb > [class^="gb_"]= bad, will be rejected as not a valid filter