demo · v135
Mutation-event linter for your code
The use case from the Intent to Remove: developers need to find every DOMSubtreeModified and DOMNodeInserted in their codebase before they break. Paste any JS — the inline linter flags each legacy event, names the recommended MutationObserver replacement, and pairs it with a live capability matrix for the current browser.
DOMNodeInserted in this browser: ?
capability matrix
event
status
replacement
paste your code
findings
the code
// Migration: every Mutation Event has a MutationObserver init equivalent.
const mo = new MutationObserver((records) => {
for (const r of records) {
if (r.type === "childList") /* added/removed */;
if (r.type === "attributes") /* attr changed */;
if (r.type === "characterData") /* text changed */;
}
});
mo.observe(node, {
childList: true,
attributes: true,
characterData: true,
subtree: true,
});
see also
- Deprecate Mutation Events — feature index
- Mutation Events vs MutationObserver — live perf comparison
- ChromeStatus entry
- MutationObserver — MDN