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' — remove element once #434

Closed
AdamWr opened this issue Jul 1, 2024 · 0 comments
Closed

Fix 'trusted-create-element' — remove element once #434

AdamWr opened this issue Jul 1, 2024 · 0 comments

Comments

@AdamWr
Copy link
Member

AdamWr commented Jul 1, 2024

It looks like that if cleanupDelayMs parameter is used, then removed element is added and removed again few times.

Steps to reproduce:

  1. Add this rule:
example.org#%#//scriptlet('trusted-create-element', 'body', 'div', '', '', '1000')
  1. Go to - https://example.org/

Added div should be removed after 1 second, but it's added again few times and then removed.
I guess that we should disconnect MutationObserver after removing element.

@adguard-bot adguard-bot changed the title Fix removing element in 'trusted-create-element' Fix 'trusted-create-element' — remove element once Jul 10, 2024
@adguard-bot adguard-bot assigned slavaleleka and unassigned maximtop Jul 10, 2024
adguard pushed a commit that referenced this issue Jul 26, 2024
Squashed commit of the following:

commit f78270a
Author: Adam Wróblewski <adam@adguard.com>
Date:   Thu Jul 25 13:04:58 2024 +0200

    Fix issue with re-adding element after removing it in 'trusted-create-element' scriptlet
@slavaleleka slavaleleka added the bug Something isn't working label Aug 2, 2024
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