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 does not work as it should #442

Open
berkant opened this issue Aug 10, 2024 · 1 comment
Open

Fix 'set-attr' — scriptlet does not work as it should #442

berkant opened this issue Aug 10, 2024 · 1 comment
Assignees

Comments

@berkant
Copy link

berkant commented Aug 10, 2024

So, here's the user rules:

example.com#%#//scriptlet('trusted-set-attr', 'body', 'test-attr1', 'test-val1')
example.com#%#//scriptlet('set-attr', 'body', 'test-attr2', 'test-val2')

Result:
image

Plus, trusted-set-attr doesn't seem to support using the attribute name as a means to concat:

example.com#%#//scriptlet('trusted-set-attr', 'body', 'test-attr3', '[test-attr1] test-attr3')

Result:
image

@adguard-bot adguard-bot changed the title 'set-attr' is broken, and doesn't work as the name implies Fix 'set-attr' — scriptlet does not work as it should Oct 7, 2024
@adguard-bot adguard-bot assigned jellizaveta and unassigned maximtop Oct 7, 2024
@slavaleleka slavaleleka added the bug Something isn't working label Oct 7, 2024
@jellizaveta
Copy link
Contributor

@berkant Hello. If I've understood you correctly, it seems that in your example:

example.com#%#//scriptlet('set-attr', 'body', 'test-attr2', 'test-val2')

the attribute value is not set because set-attr does not support custom values.

Unfortunately, I don't understand this example, could you please describe it in more detail:

example.com#%#//scriptlet('trusted-set-attr', 'body', 'test-attr3', '[test-attr1] test-attr3')

4 parameter in trusted-set-attr is the attribute value

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

5 participants