I have search all over internet if get the full code of an html document in javascript including dynamically injected html or scripts or css and cannot find any clue.
So is it possible ? If yes any code snippet ?
I have search all over internet if get the full code of an html document in javascript including dynamically injected html or scripts or css and cannot find any clue.
So is it possible ? If yes any code snippet ?
document.documentElement.outerHTML
would give you the entire HTML of the current DOM state, including changes made by JavaScript. Not sure what you mean by "including CSS".
If you use it, don't forget to add
<!DOCTYPE html>
at the top