(appears to work on rendered plaintext, does not work on json response type (e.g. https://api.github.com) - browser JSON rendering controls get included in text).
i.e. document.contentType == "text/plain"
:
document.documentElement.textContent
document.documentElement.innerText
(full html but not hash equivalent, changes case "!DOCTYPE"):
new XMLSerializer().serializeToString(document)