I'm completely confused how to inject an entire html to another html using content scripts in chrome extension.
I'm currently doing
document.body.innerHTML += 'html';
But that only helps when injecting some minor html code, and not an entire html file, which has its own css and js files.
How do I achieve this?
document.body.innerHTML += '..';, because it will break almost every dynamic site on the internet....innerHTML +=will remove all event listeners and invalidate any previous element references. It should only be used on content you "own".<body>elements in arbitrary web pages do certainly not meet that criterium.