ChromeDevTools / devtools-protocol

Chrome DevTools Protocol
https://chromedevtools.github.io/devtools-protocol/
BSD 3-Clause "New" or "Revised" License
1.15k stars 226 forks source link

large nodeValues truncated in DOM.getDocument and DOM.getFlattenedDocument #205

Closed dwsmart closed 4 years ago

dwsmart commented 4 years ago

If a nodeValue is large, it is truncated with ellipsis.

This is problematic if the node is something like a larger inline script or style.

For example, if the attached file was inline on a page example.css.txt

The nodeValue returned would truncate at:

.v-application .info.lighten-2 { background-color: #6aded0 !important; border-color: #6aded0 !important; } .v-application .info--text…

Is this a bug? Is there a work around to have these not truncate nodeValue and return the full value in these methods?

dwsmart commented 4 years ago

Apparently by design, the solution is to use DOMSnapshot.captureSnapshot and rebuild the tree.

https://bugs.chromium.org/p/chromium/issues/detail?id=1040553#c6