Scriptlets icon indicating copy to clipboard operation
Scriptlets copied to clipboard

Improve 'trusted-suppress-native-method' — some methods cannot be suppressed

Open Yuki2718 opened this issue 1 year ago • 6 comments

I tried to suppress Math.floor with

exploader.net#%#//scriptlet('trusted-suppress-native-method', 'Math.floor', '/([12]\d\.\d+|\d\.\d+)/', 'prevent')

but it fails. This is more of a question, but is it possible to suppress methods without argument such as Math.random and Element.prototype.getBoundingClientRect? "" as the argment doesn't work.

Yuki2718 avatar Dec 17 '24 10:12 Yuki2718

In these commits https://github.com/AdguardTeam/AdguardFilters/commit/ef869c8a7213f041fd7d06587d25ce63a7924d50 https://github.com/uBlockOrigin/uAssets/commit/5ff8cb6a75c2c17b685297462ff35015d407c035 I found the same abort-on-stack-trace doesn't work with AG extension, the same result with trusted-suppress-native-method with abort. I had to use abort-on-property-read instead.

Yuki2718 avatar Apr 07 '25 09:04 Yuki2718

Regarding last comment. I checked it out with:

pvpoke-re.com#@%#//scriptlet('abort-on-property-read', 'Object.assign')
pvpoke-re.com#%#//scriptlet('abort-on-stack-trace', 'Object.assign', '.js?v=')

and it seems that it works fine on my end (it prevents displaying anti-adblock popup).

In which browser and with what AdGuard version did you test it?

AdamWr avatar Apr 07 '25 12:04 AdamWr

Chrome and 5.1.70.

Yuki2718 avatar Apr 07 '25 12:04 Yuki2718

Do you still can reproduce it? I checked it with Chrome MV2/3 extension and it works fine.

AdamWr avatar Apr 07 '25 12:04 AdamWr

I can't reproduce any longer, not sure what was happening. I'll update the rule.

Yuki2718 avatar Apr 07 '25 12:04 Yuki2718

Thank you for checking it out.

AdamWr avatar Apr 07 '25 12:04 AdamWr