AdguardTeam / Scriptlets

AdGuard scriptlets library
GNU General Public License v3.0
150 stars 30 forks source link

Different results in AdGuard and uBO with the same rules #73

Closed Alex-302 closed 4 years ago

Alex-302 commented 4 years ago
  1. sinoptik.ua https://github.com/AdguardTeam/AdguardFilters/issues/51477 This rule blocks ad reinjection script in uBO: sinoptik.ua##+js(set-constant, String.prototype.charCodeAt, trueFunc) but not blocks in AdGuard(extension) sinoptik.ua#%#//scriptlet("set-constant", "String.prototype.charCodeAt", "trueFunc")
  2. fastpic.ru https://github.com/AdguardTeam/AdguardForWindows/issues/3232 These rules breaks described in the issue button in AdGuard, but not in uBO:
    fastpic.ru#%#//scriptlet('ubo-abort-current-inline-script.js', 'document.createElement', 'Math.random')
    fastpic.ru#%#//scriptlet('ubo-abort-on-property-read.js', 'document.getElementsByTagName')
ameshkov commented 4 years ago

Both are interesting cases, we should figure out what's wrong with them

Alex-302 commented 4 years ago

Another one case where scriptlet does not help https://github.com/AdguardTeam/AdguardFilters/issues/51872

ameshkov commented 4 years ago

The website checks charCodeAt function length and if it's less than 28 characters, it for some reason decides to not show ads at all. No idea why this is happening, but there's definitely no issues with how AG scriptlets works.

Short-term solution: use something like #%#String.prototype.charCodeAt = function() { return true; }

However, I am pretty sure it will stop working eventually and we'll need to find a better one.