Skip to content

Explore using selector-observer to run features #3084

@fregante

Description

@fregante

GitHub uses selector-observer to enable logic on simple classes, which is why adding or removing classes like .js-fit-content will enable or disable their features.

It's built around MutationObserver with various optimizations on top of it. Its performance might not be super (https://bugzilla.mozilla.org/show_bug.cgi?id=1422522) but it seems to work well enough for GitHub.

It's worth investigating if anyone has time, it would elegantly solve issues around dynamic content and all the specific listeners we have.

I think observe calls would go inside each feature’s init, which could only be called once.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Please! ♥︎Particularly useful features that everyone would love!help wantedmetaRelated to Refined GitHub itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions