AdguardTeam / Scriptlets

AdGuard scriptlets library
GNU General Public License v3.0
148 stars 29 forks source link

Fix 'remove-cookie' — broken kupi.cz #326

Closed zloyden closed 6 months ago

zloyden commented 1 year ago

https://github.com/AdguardTeam/AdguardFilters/issues/153225. Seems like a bug in our extension, which is caused by kupi.cz#%#//scriptlet('ubo-cookie-remover.js', '/^_?adb/'). I can't reproduce it in uBO.

AdamWr commented 1 year ago

As I recall, it's some kind of ad reinjection script and after refreshing website few times I can reproduce it with uBO as well.

Screenshot ![image](https://github.com/AdguardTeam/Scriptlets/assets/29142494/45830525-6c28-44bf-8bae-6c4f66272fd4)

It looks like that if adb cookie is removed by scriptlet, then some scripts do not load for some reason, but I'm not sure if it's a scriptlet issue.

Screenshot ![image](https://github.com/AdguardTeam/Scriptlets/assets/29142494/07f98cc0-b92f-4733-a655-a17ade7a38fe)

It seems that if adb cookie is removed before reloading a website, then it also works correctly, so maybe this part: https://github.com/AdguardTeam/Scriptlets/blob/323fd41e0f2e3eb540555f2b182d0aefd1874db0/src/scriptlets/remove-cookie.js#L89 doesn't work correctly in this case.

zloyden commented 1 year ago

but I'm not sure if it's a scriptlet issue.

I'm also not sure about it. but here's the thing. I exchanged the scriptlet for a $cookie rule and it has been working fine on my side.