AdguardTeam / AdguardBrowserExtension

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

$cookie rule cannot delete some cookies #1511

Open ghost opened 5 years ago

ghost commented 5 years ago

I have my own hosts file to block extra ads and trackers where I use $cookie to try and block tracking cookies but it doesn't appear to be working. Am I doing something wrong or is it not working?

(The link below is the exact spot where I have it set to block the cookies) https://github.com/Cybo1927/Hosts/blob/master/Hosts#L20193

Extension version: 3.2.1 Browser: Brave Developer Edition & Google Chrome Operating System: Windows 10

Additional information: The exact problem is that the extension doesn't seem to be blocking the cookies from being set (Images below)

image

image

ghost commented 5 years ago

After some testing-I changed settings and tested them and tried not using regular expression-I believe it's the extension.

Alex-302 commented 5 years ago

@Cybo1927 please provide cookie example end regexp, which should to match that cookie name.

ghost commented 5 years ago

The cookie example was in the two pictures? and for all the cookies I wanted to block I put the regular expression [a-zA-Z_.] ( e.g. $cookie=/_shopifyy[a-zA-Z.]|_shopifycountry[a-zA-Z.]/ )

Edit: I don't know why but in the parenthesis the underscore before the period doesn't show up

Alex-302 commented 5 years ago

try to add + after [a-zA-Z.] etc

ghost commented 5 years ago

No matter what it's not blocking the cookies even though it says it is.

Edit: Even just using $cookie to try and block all cookies from a domain doesn't work.

ameshkov commented 4 years ago

Steps to reproduce

  1. Add $cookie=/shopify/ to the user filter
  2. Open https://theodd1sout.com/
  3. Check the filtering log -- you'll see that the cookie rule was applied
  4. Examine the website's cookies -- they are still there

What happened

I suppose there's an issue with the timing, we remove the matching cookie right away -- before they were actually created by the browser.

I don't see them in the cookie header so sending them to the server is suppressed.

ameshkov commented 4 years ago

The good news is that these cookies are actually removed every time the page is requested. The bad news is that they are being set again by the page scripts, and AG does nothing with them after that.

ghost commented 4 years ago

I suppose there's an issue with the timing, we remove the matching cookie right away -- before they were actually created by the browser.

I don't see them in the cookie header so sending them to the server is suppressed.

Yup, seems to be the case. At least they're not being sent to any server, that's better than it not working at all.

XX-J commented 3 years ago

У меня похожий случай, только наоборот - не успевают ВСЕ куки разблокироваться правилом-исключением @@||aliexpress.*$cookie, или оно срабатывает ДО создания ВСЕХ кук. Подробнее #83668.

Screenshot: ![Video_2021-05-19](https://user-images.githubusercontent.com/17948007/119010535-d4228180-b99c-11eb-909f-8f75cf94cccf.gif)

Adguard v3.5.34 | FireFox v78.10 ESR | Win7SP1 Базовый фильтр AdGuard | Русский фильтр | Фильтр раздражителей Фильтр виджетов социальных сетей | Фильтр счетчиков и систем аналитики Антитрекинг: Стандарт + Блокировка WebRTC