title: Opening and writing to a new window from a Google Chrome extension sandbox page
body: <p>(Cross posted <a href="https://groups.google.com/a/chromium.org/d/topic/chromium-extensions/n3BvWwSJxAw/discussion" rel="nofollow">here</a>)</p>
  
  <p>Hi,</p>
  
  <p>I have a sandboxed page (specified in my manifest) which is loaded into an iframe in my extension's background page. From within my sandboxed page, I'd like to open a new window and write to it, i.e.:</p>
  
  <p>var win = window.open(); win.document.write('&lt;p&amp;gtHello!&lt;/p&gt;');</p>
  
  <p>This works from my extension's background page and from regular web pages, but when invoked from either content scripts or my sandboxed page, the window opens, but I cannot access the win object (it's defined, but empty---console.log outputs "Window {}"). </p>
  
  <p>I assume this is due to same-origin policies (with every window being given a uinque-origin within the sandboxed environment). However, since the window opens an about:blank page, I'm confused why this would matter.</p>
  
  <p>Is this a feature? Is there a parameter I can add to my manifest to avoid this?  And does anyone know of work-arounds that don't involve using postMessage back to my background page? My ideal solution is to have my sandboxed script open a new window and interact with it directly, not with message passing.</p>
  
  <p>I can provide a full example if necessary, but I'm hoping someone might just know off the top of their head. I'm running Chrome 24.0.1312.57 on Mac and 24.0.1312.68 on Ubuntu if that helps.</p>
  
  <p>Thanks,</p>
  
  <p>Hank</p>