AdguardTeam / Scriptlets

AdGuard scriptlets library
GNU General Public License v3.0
138 stars 27 forks source link

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

Open AdamWr opened 3 weeks ago

AdamWr commented 3 weeks ago

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')
  2. 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.