Currently element is added every time when there is change in DOM.
Steps to reproduce:
- Add these rules:
example.org#%#//scriptlet('trusted-create-element', 'body', 'a')
example.org#%#//scriptlet('trusted-create-element', 'body', 'div')
- 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')