Is there a way to access the page HTML source code using javascript?
I know that I can use document.body.innerHTML but it contains only the code inside
document.body.innerHTML
This can be done in a one-liner using XMLSerializer.
var generatedSource = new XMLSerializer().serializeToString(document);
Which gives String
html - javascript page source code - Stack Overflow ...