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 'trusted-create-element' — do not add element on every DOM changes #450

Closed
AdamWr opened this issue Sep 2, 2024 · 0 comments
Closed

Comments

@AdamWr
Copy link
Member

AdamWr commented Sep 2, 2024

Currently element is added every time when there is change in DOM.

Steps to reproduce:

  1. Add these rules:
example.org#%#//scriptlet('trusted-create-element', 'body', 'a')
example.org#%#//scriptlet('trusted-create-element', 'body', 'div')
  1. Go to - https://example.org/

Website is unresponsive because elements are added in the loop.


Consider also a case when one element is added inside another:

example.org#%#//scriptlet('trusted-create-element', 'body', 'foo')
example.org#%#//scriptlet('trusted-create-element', 'body > foo', 'bar')
@adguard-bot adguard-bot changed the title Fix trusted-create-element — do not add element on every DOM changes Fix 'trusted-create-element' — do not add element on every DOM changes Sep 5, 2024
@adguard-bot adguard-bot assigned slavaleleka and unassigned maximtop Sep 5, 2024
@slavaleleka slavaleleka added the bug Something isn't working label Sep 5, 2024
adguard pushed a commit that referenced this issue Sep 12, 2024
…OM changes. #450

Squashed commit of the following:

commit d3dc9d5
Author: Adam Wróblewski <[email protected]>
Date:   Thu Sep 12 11:17:20 2024 +0200

    Fix issue with re-adding element on every DOM change in 'trusted-create-element' scriptlet
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