AdguardTeam / AdguardBrowserExtension

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

Filters not updating when permissions set to "specific sites" on extension in edge v111 #2314

Open MysticalCreation opened 1 year ago

MysticalCreation commented 1 year ago

image

image

contribucious commented 1 year ago

Confirmed. :thumbsup:

Indeed, I spotted this problem too (a report was planned for later in my todo list).

But in my case, not by setting Site access value to On specific sites (although also confirmed) but to On click.

View screenshot … ![AG Edge](https://user-images.githubusercontent.com/4764956/228322126-49117d1d-803c-43d3-8595-32e4b25543f4.png)

💭 Since logically the extension is limited at the browser level by this set value, there is a good chance that it is not solvable I think (not sure at all however, luckily there is a solution). But anyway, if the extension can manage to determine when this case is encountered, a more explanatory notification might be nice at least. Or else, possibly add details about that in the KB, possibly in a new Specific cases section.

contribucious commented 1 year ago

:bulb: Workaround

Reveal … ### For your case — `On specific sites` I note that unlike my situation, for your specific case, you can successfully both update your filters (either from the AG settings or from the AG popup _anywhere_) and add new ones just by adding: - `https://filters.adtidy.org/*` in the [allowed list](https://user-images.githubusercontent.com/4764956/228366434-e5ef4ba3-11ec-4c85-b601-7c65929a9510.png) — it's the [official domain name](https://github.com/AdguardTeam/FiltersCompiler/blob/a843db5a7a49f87364d325db54ab1177841f955f/src/main/builder.js#L41); - any other domain names you need for your filters: - ~~either from AdGuard's list of third-party filters by checking [this page](https://github.com/AdguardTeam/FiltersRegistry/tree/master/filters/ThirdParty) > click on the third-party filter you use currently/sometimes > `metadata.json` > look at the `subscriptionUrl` property (and now, based on the value you see there, just add `https://[the-found-domain-name]/*` to your allowed list);~~

:arrow_right: **UPDATE:** NOT REQUIRED IN FACT (everything goes through `filters.adtidy.org`). ✔️ - … or any domain name where you host your lists or you use. ### For my case — `On click` - Go to _any_ filter (no matter which one) on the concerned domain name, like here: https://filters.adtidy.org/extension/chromium/filters/2.txt (or better, [this 8.txt](https://filters.adtidy.org/extension/chromium/filters/8.txt), loads faster as it's smaller); - Click on the extension icon > then on the [only button](https://user-images.githubusercontent.com/4764956/228333709-0b0ee36a-4251-47f0-926c-ce2faf74b628.png) present to allow it to run on this domain name > and then use the [_refresh_ icon](https://user-images.githubusercontent.com/4764956/228343935-cec5ffea-c6a4-4b5e-b41d-a83246d223ea.png) in the extension popup.
↪️ Repeat these two steps for each domain name where you have _custom_ filters on it… Not very practical for sure though. :relaxed:
  **Tip:** For the latter case, better to switch to `On specific sites` and add _just_ the necessary domain name(s) listed above for the filters to update. As the extension icon will be in `On click` mode on _any non-listed_ domain name, anyway. So, same result but with a functional update of filters. :wink:
MysticalCreation commented 1 year ago

Hi, thanks for workaround but unfortunately it's not working still. I did what you said and added domain names in the allowlist and still get the error.

image

but still get the error- image

Also ublock origin doesn't have this issue of updating filters even on limited website access permissions so I'm confused why it might not be possible in adguard. This feels like a bug and not a limitation of the browser.

contribucious commented 1 year ago

Hi. :wave: Three things:

Firstly, it's not the "Allowlist" of AdGuard but the one in Edge's extension details (see this screenshot again).

Secondly, URL format will be https://easylist-downloads.adblockplus.org/* (and not https://easylist-downloads.adblockplus.org/antiadblockfilters.txt/*). (And small note: /* will be auto. added by Edge if omitted.)

Thirdly, after verification, all filters natively included in AdGuard, even 3rd-party ones, go through filters.adtidy.org in fact (I updated my post, sorry about that so). Therefore, only the domain names of your possible "Custom filters" (if used) are to be added in addition to https://filters.adtidy.org/*.

Tested and working. :thumbsup:
contribucious commented 1 year ago

So, in your specific case (based on your screenshot):

1) Go to AdGuard extension details in Edge.

**Direct URL access:**
if installed via the Chrome Web Store ››› `edge://extensions/?id=bgnkhhnnamicmpeenaelnjfhikgbkllg`
if installed via the Microsoft Edge Add-ons Store ››› `edge://extensions/?id=pdffkfellgipmhklpdmokmckkkfcopbh`

2) Click this "Add" button and add just these 3 ones:

And don't forget to remove the wrongly added things from your AdGuard's Allowlist of course. :wink:
MysticalCreation commented 1 year ago

So, in your specific case (based on your screenshot):

  1. Go to URL edge://extensions/?id=bgnkhhnnamicmpeenaelnjfhikgbkllg (or manually go to AdGuard extension details in Edge);
  2. Click this "Add" button and add just these 3 ones:
  • https://filters.adtidy.org/*
  • https://gitlab.com/*
  • https://big.oisd.nl/*
And don't forget to remove the wrongly added things from your AdGuard's Allowlist of course. 😉

thank u so much. This works. Hopefully a proper fix is released soon.

MysticalCreation commented 1 year ago

@contribucious I just have one unrelated query hopefully you can answer it since you're here. I always wondered that extensions said that they have permission to read all websites data. Does setting the permission to "specific sites" or "on click" take away that permission since the text indicating that the permission still has complete website data access is still there?

image

contribucious commented 1 year ago

According to me, but I could be wrong, Edge just reports that the extension has been configured by the developer to have this (large) access.

But, on the user side (line just below), you can limit the thing.

But the AdGuard team will correct me if necessary. :wink:
krystian3w commented 1 year ago

I reproduced with uBlock Origin for Peter Lowe list @gwarser.

settings:

image
image
image

mismatched error (network conection is fine):

image
gwarser commented 1 year ago

Extensions background page can access any URL, no matter the permission, when server responds with proper CORS header (basically access-control-allow-origin: *). in uBO, lists mirrored on github.io are downloaded without errors, because it uses CORS.


AdGuard's servers work fine.

contribucious commented 1 year ago

@gwarser That's a good news! A proper fix for this issue is possible therefore. ✔️

Indeed, regarding default configuration of uBO on Edge:

 


About AdGuard's servers / extension

But, as @gwarser said, AdGuard's servers are fine regarding CORS header stuff (I only added the FRA: AdGuard Français filter list to the default uBO configuration, to test).

So … AdGuard's servers are OK under uBO but not under AdGuard Browser extension … 🤔

Regarding the latter, see screenshots of:    ✖️ frontend error, backend error 1, backend error 2 (and backend errors overview).

…Versus, when set on "On all sites" (only Base filter used here, just for info, but same with various ones that got correctly updated):    ✔️ frontend OK, backend OK 1, backend OK 2 (and backend OK overview).    ↪️ Instead of a OPTIONS request (receiving a 403 Forbidden):            - we see two GET requests (both receiving a 200 OK);            - plus the request to the Base filter file (2.txt), only because an update was available in this case. Else, request not present.