Skip to content

Improve SelectorObserver performance #94

@Sv443

Description

@Sv443

By checking which selectors are affected by a MutationObserver trigger and only calling the listeners of those, the performance should be MUCH better on more complex pages with frequent DOM changes.
To achieve this, for each added/removed/edited node and for each registered selector, check if the element itself matches the selector (via changedElement.matches(selector)), the selector is a child of the element (via changedElement.querySelector(selector)) or descend up the parents of the element.
This whole functionality should be toggleable with a constructor option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions