title: Inject an opened window with script
body: <p><a href="https://stackoverflow.com/questions/1161378/how-can-i-load-a-web-page-into-a-new-window-and-inject-javascript-code-into-it">This question</a> asks for a way to open a new window using <code>window.open</code> and then inject it with a script. It was not possible because of cross-domain security issues.</p>
  
  <p>However, my problem is that I want to do the exact same thing, except from the same domain to the same domain. Is this possible?</p>
  
  <p>Note that <code>.write</code> does not solve this problem because it wipes all the html from the page first.</p>