I would like to make a Chrome extension that provides a new object inside window. When a web page is viewed in a browser with the extension loaded, I would like
window
Thanks to the other answers here, this is what I'm using:
((source)=>{ const script = document.createElement("script"); script.text = `(${source.toString()})();`; document.documentElement.appendChild(script); })(function (){ // Your code here // ... })
Works great, no issues.