Closed
Description
Steps to reproduce:
- Add this rule:
example.org#%#//scriptlet('prevent-fetch', 'googlesyndication', '', 'opaque')
2, Go to - https://example.org/
3. In browser console run:
(async () => {
try {
const response = await fetch('https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', {
mode: 'no-cors'
});
if (response.ok) {
alert('adblock');
}
} catch (error) {
alert('adblock');
}
})();
Alert is displayed, because response.ok
is true
, but without ad blocker is false
.
Adding ok: { value: false; }
to:
Scriptlets/src/helpers/noop-utils.ts
Lines 126 to 132 in 85b3346
should fixes it.
This issue - #394 (comment) could be also fixed.
I think that the problem is that website overrides Object.defineProperties which is used by prevent-fetch.