What is the best way to get the HTML of a page with all shadow DOM flattened.
I can see in the Chrome Devtools Protocol that there is a DOMSnapshot.captureSnapshot that returns a DocumentSnapshot object. However I’m not sure how to go from this to the HTML.
GoogleChromeLabs has a ‘dom2html’ script that serialises a dom-like JSON tree into HTML but I can’t see how to convert the above DocumentSnapshot object into a dom-like JSON tree to use by this script.
Thanks for any help