Avoids Mutation Events In Its Own Scripts

Overview

The following mutation events harm performance and are deprecated in the DOM events spec:

  • DOMAttrModified
  • DOMAttributeNameChanged
  • DOMCharacterDataModified
  • DOMElementNameChanged
  • DOMNodeInserted
  • DOMNodeInsertedIntoDocument
  • DOMNodeRemoved
  • DOMNodeRemovedFromDocument
  • DOMSubtreeModified

Recommendations

Under URLs, Lighthouse reports each mutation event listener that it found in your code. Replace each of these mutation events with a MutationObserver. See MutationObserver on MDN for more help.

More information

Lighthouse collects all of the event listeners on the page, and flags any listener that uses one of the types listed above.

Feedback