What's the state of cross-browser support for DOM Mutation Observers?

后端 未结 2 1388
情歌与酒
情歌与酒 2021-02-05 21:49

I googled but couldn\'t find an answer.

Is there a cross-browser compatibility matrix available for this feature?

In case anybody wants to know the answer, here

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-05 22:17

    Ido Green provided the answer, but for clarity I will post relevant snippets of the linked docs here.

    https://developer.mozilla.org/en-US/docs/DOM/Mutation_events

    DOM Mutation Events are now deprecated.

    The mutation events have been marked as deprecated in the DOM Events specification, as the API's design is flawed (see details in the "DOM Mutation Events Replacement: The Story So Far / Existing Points of Consensus" post to public-webapps).

    The practical reasons to avoid the mutation events are performance issues and cross-browser support.

    These are being replaced by DOM Mutation Observers.

    https://developer.mozilla.org/en-US/docs/DOM/MutationObserver

    Mutation Observers provides developers a way to react to changes in a DOM. It is designed as a replacement for Mutation Events defined in the DOM3 Events specification.

    • A brief overview
    • A more in-depth discussion
    • A screencast by Chromium developer Rafael Weinstein
    • The mutation summary library
    • The DOM4 specification which defines the MutationObserver interface

提交回复
热议问题