Scriptlets
Scriptlets copied to clipboard
Fix 'abort-on-stack-trace' — do not assign 'window' to property which was not set
Currently when a rule like this is used:
example.com#%#//scriptlet('abort-on-stack-trace', 'foo.bar', 'whatever')
then foo is set to window, but it should be undefined.
Screenshot
I'm not sure, but perhaps here: https://github.com/AdguardTeam/Scriptlets/blob/3ba245f96237915bbff6fe80c7400b03c0f5014d/src/scriptlets/abort-on-stack-trace.js#L94-L106 we could change it to:
if (chain) {
base = owner[prop];
const setter = (a) => {
[...]
Related issue - https://github.com/AdguardTeam/AdguardFilters/issues/209732