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 'set-attr' scriptlet — value cannot be set to '0' and '32767' #425

Closed
AdamWr opened this issue Apr 24, 2024 · 0 comments
Closed

Fix 'set-attr' scriptlet — value cannot be set to '0' and '32767' #425

AdamWr opened this issue Apr 24, 2024 · 0 comments

Comments

@AdamWr
Copy link
Member

AdamWr commented Apr 24, 2024

Steps to reproduce:

  1. Add this rule:
example.org#%#//scriptlet('set-attr', 'h1', 'data-ad-status', '0')
  1. Go to - https://example.org/

h1 element should has data-ad-status attribute, but if value is 0 then it doesn't work (it works fine if it's set to 1).

Probably problem is here:

&& parseInt(value, 10) > 0

Previously it was possible to use 0 as value, but now it doesn't work.

@adguard-bot adguard-bot assigned slavaleleka and unassigned maximtop Apr 24, 2024
@adguard-bot adguard-bot changed the title Fix set-attr scriptlet — value cannot be set to 0 Fix 'set-attr' scriptlet — value cannot be set to '0' Apr 24, 2024
@adguard-bot adguard-bot changed the title Fix 'set-attr' scriptlet — value cannot be set to '0' Fix 'set-attr' scriptlet — value cannot be set to '0' and '32767' Apr 26, 2024
adguard pushed a commit that referenced this issue May 6, 2024
Squashed commit of the following:

commit c576343
Author: Adam Wróblewski <[email protected]>
Date:   Fri Apr 26 14:49:02 2024 +0200

    Update changelog

commit 701c536
Author: Adam Wróblewski <[email protected]>
Date:   Fri Apr 26 11:25:34 2024 +0200

    Fix typo

commit 68661c9
Author: Adam Wróblewski <[email protected]>
Date:   Fri Apr 26 11:21:37 2024 +0200

    Fix set-attr - value cannot be set to 0 and 32767
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

4 participants