ChromeDevTools / debugger-protocol-viewer

DevTools Protocol API docs—its domains, methods, and events
https://chromedevtools.github.io/devtools-protocol/
Other
854 stars 173 forks source link

"DOM.getFlattenedDocument" -- Different results between the same service sites in two different network environments #178

Open sxnys opened 2 years ago

sxnys commented 2 years ago

Chrome Version 95.0.4638.54

When I use devTools protocol "DOM.getFlattenedDocument", I got different results between the same site in two different network environments. The site has two layers of iframes nested.

What steps will reproduce the problem?

Send commad DOM.getFlattenedDocument with parameters {"depth": -1, "pierce": true}, with "Protocol monitor" in DevTools or using chrome.debugger.sendCommand:

chrome.debugger.sendCommand(debuggeeId, "DOM.getFlattenedDocument", {
            depth: -1,
            pierce: true
        }, function (res) {})

THE SAME SITE DEPLOYED IN TWO DIFFERENT ENVIRONMENTS!

  1. Send commad DOM.getFlattenedDocument in env1, I got node list with 14590 items. image

  2. Otherwise, send commad DOM.getFlattenedDocument in env2, I got node list with 12779 items. image

By comparison, it is found that the innermost iframe is not recognized in the second environment.

More

The document with "DOM.getFlattenedDocument" is following. image And I try to use DOMSnapshot.captureSnapshot instead, but I got the same issuse.