9951 explained code solutions for 126 technologies


chrome-extensionHow to access or modify window object


var script = document.createElement('script');
script.textContent = 'console.log(window);';
(document.head||document.documentElement).appendChild(script);ctrl + c
var script

init script DOM element

script.textContent

set script content (js code)

console.log(window);

place your window object manipulation code here

appendChild(script)

inject script into a page