Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'prevent-element-src-loading' — thrown error if 'thisArg' is undefined #270

Closed
AdamWr opened this issue Dec 19, 2022 · 1 comment
Closed

Comments

@AdamWr
Copy link
Member

AdamWr commented Dec 19, 2022

Steps to reproduce

  1. Add this rule
example.org#%#//scriptlet('prevent-element-src-loading', 'script', 'TEST_WHATEVER_QWERTYU')
  1. Go to - https://example.org/
  2. In browser console run:
addEventListener('visibilitychange', () => {
    console.log('test');
});

Script should works correctly, but it throws error, because thisArg is undefined in this case.

Screenshots

image

image

It looks like that it's a new issue and it worked correctly in previous version (I mean in scriptlets library 1.6.x).

@AdamWr
Copy link
Member Author

AdamWr commented Dec 26, 2022

Probably related issue - AdguardTeam/AdguardFilters#138389
Video player is broken due to:

player.pl#%#//scriptlet('prevent-element-src-loading', 'script', '/assets/adverts_.js')

but it worked correctly with previous version.

@adguard-bot adguard-bot changed the title Fix issue with thisArg in prevent-element-src-loading Fix issue with 'thisArg' in 'prevent-element-src-loading' Jan 16, 2023
@adguard-bot adguard-bot changed the title Fix issue with 'thisArg' in 'prevent-element-src-loading' Fix 'prevent-element-src-loading' — issue with 'thisArg' Mar 1, 2023
adguard pushed a commit that referenced this issue Mar 2, 2023
Squashed commit of the following:

commit d3de256
Author: Adam Wróblewski <adam@adguard.com>
Date:   Wed Mar 1 16:48:48 2023 +0100

    Fix issue with undefined thisArg in prevent-element-src-loading
@adguard-bot adguard-bot changed the title Fix 'prevent-element-src-loading' — issue with 'thisArg' Fix 'prevent-element-src-loading' — thrown error if 'thisArg' is undefined Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants