AdguardTeam / AdguardBrowserExtension

AdGuard browser extension
https://adguard.com/
GNU General Public License v3.0
2.99k stars 321 forks source link

Add validation for allowlist #2615

Open pejotigrek opened 9 months ago

pejotigrek commented 9 months ago

AdGuard Extension version

4.2.226

Browser version

119.0.6045.160 (Official) (64-bit)

OS version

Windows 10

What filters do you have enabled?

AdGuard Base filter, AdGuard Annoyances filter, AdGuard Cookie Notices filter, AdGuard Popups filter, EasyList China, EasyList Germany, EasyList Italy, Liste FR, Official Polish filters for AdBlock, uBlock Origin & AdGuard, Polish Social Filters, EasyList Spanish, KAD - Anti-Scam, Polish Annoyances Filters, Polish Anti Adblock Filters, NoCoin Filter List, EasyList Polish, Polish Anti-Annoying Special Supplement

What Stealth Mode options do you have enabled?

No response

Issue Details

Extension keeps turning off - the icon is greyed out, so I am trying to turn on the protection, seems like it works, but after reloading the page - again it is turne off and no protection is applied.

Expected Behavior

AdGuard protection working as usual.

Screenshots

Screenshot 1: after starting the chrome browser and entering *any* page ![image](https://github.com/AdguardTeam/AdguardBrowserExtension/assets/10796588/4fc03c0c-8f95-483e-b44d-ac8d96e83e49)
Screenshot 2: when I tap on the switch, page reloads and switch shows green [but the icon is still greyed] ![image](https://github.com/AdguardTeam/AdguardBrowserExtension/assets/10796588/fe490608-52c0-4e43-950d-e8d4f3d78c62)
Screenshot 3: so I close the AdGuard's popup, again press on the icon and see the switch turned off: ![image](https://github.com/AdguardTeam/AdguardBrowserExtension/assets/10796588/64bbffdd-7edf-4bc8-be97-c9b509f78223)

Additional Information

No response

pejotigrek commented 9 months ago

further investigation:

I am not sure if I've missed some changes in the allowed/user lists but here's what I've found:

example of the rule that "kills" the protection:

@@||androidcentral.com/$document

[I had this for sooo long, I don't even remember when I've entered it ;) but checking with rules syntax, I've tried also as @@||androidcentral.com^$document and it killed the protection too]

DerFreischutzTKH commented 9 months ago

same here, i think they did it again https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2461

Exactly the same bug, after remove @@||xxx.com^ from my allowlist, extension works fine again wtf

maximtop commented 9 months ago

@DerFreischutzTKH, @pejotigrek AdGuard's allowlist doesn't support rules, only plain text with domain names (example.org). Recently, we've added support for wildcards (*.example.com), which might explain why your rules started turning protection off. If you want to use rules, then add them to the user rules section. I think we should add validation for the allowlist.

pejotigrek commented 9 months ago

@maximtop out of curiosity: is it possible that rules worked before? like I mentioned - I think I had those rules "almost forever" in my allow list [I really don't even remember writing some of them by hand.. so maybe were added automagically when using some "block this/allow this" options in the menu/icon?]

+1 for validation, it gave me a while to get to the list and then to find out what's blocking the protection. simple notification or even red icon color could be a nice addition :)

maximtop commented 9 months ago

is it possible that rules worked before?

It's unlikely that these rules worked as intended before. If they did, it must have been quite some time ago.