0

I'm trying to use DevTools protocol - for DOM domain events:https://chromedevtools.github.io/devtools-protocol/tot/DOM/

I activate the DOM domain, it is successfully activated.

Now I get events, BUT when loading the URL - I always get only one event: DOM.documentUpdated

Other events such as:

DOM.attributeModified
DOM.attributeRemoved
DOM.characterDataModified
DOM.childNodeCountUpdated
DOM.childNodeInserted
DOM.childNodeRemoved
DOM.documentUpdated
DOM.setChildNodes

they never come. Is this how it should be ?

. . .

I found a similar problem: DOM event attributeModified/attributeRemoved/characterDataModified... are not triggered

Apparently the DOM-domain for Chrome DevTools protocol - is not working correctly.

Optimus1
  • 444
  • 2
  • 13

1 Answers1

1

A funny thing about the DOM domain is that the node events are only sent regarding nodes that are in the frontend. Nodes are in the backend by default.

A simple call to DOM.getDocument with depth set to -1 and pierce set to true will push all the nodes to the frontend. Please note that pierce is relevant for sub-documents (such as iframes) and is not necessary in many occasions.

All changes to frontend nodes will be reported to you via the events you mentioned.

Kle0s
  • 113
  • 1
  • 8