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.
Not sure if this is what you mean, but you can just save a webpage from the browser. On Chrome I am able to download the css, js, and assets as well as the HTML document.
"dynamically injected html" - Do you mean, for example, changes to the DOM performed by the JavaScript code being executed on that page? If so then the search term you're looking for is probably "headless browser".
document.querySelector('html').innerHTML?