When you send DOM.getDocument, you get a number of DOM.setChildNodes in
return. They should include the children of the document node (I think we
push nodes 2 levels deep upon getDocument). That's why subsequent calls
to DOM.requestChildNodes(documentNodeId) results in no setChildNodes -
backend remembers that it has been sending those children to you
already. In order to get all the events, you need to traverse entire DOM
and hence become aware of all of the nodes.
But I wonder if you should use DOM domain for your task. DOM domain API is
for visualizing DOM only, that's why it is structured in such an unusual
way. There are other ways of getting that info such as: listening to
domain and emitting signals using console or using some other ways.
Could you share what kind of problem you are solving so that we could help