title: Open and pass data to a popup (new tab) from content script
body: <p>I'm writing a chrome extension and have a question.</p>
  
  <p>My extension has some .html page in it, let it be 'popup.html'. I inject a content script into some page and this script opens a 'popup.html' in a new tab with something like 'var p = window.open(chrome.extension.getURL('/popup.html'), "popup")', which works perfectly. Next, I need to pass some data to this window and I can't figure how to do it in a simple way.</p>
  
  <p>For some reason I can't call child window's function from a content script with</p>
  
  <pre><code>var p = window.open(chrome.extension.getURL('/popup.html'), "popup");
  p.foo(data);
  </code></pre>
  
  <p>In the console I see <em>Uncaught TypeError: Cannot call method 'foo' of undefined</em> message.</p>
  
  <p>I can't pass data in a query string, because the data is simply too big. </p>
  
  <p>Is there an elegant and simple way to pass data to such kind of window? I thought about messaging, but how do I effectively get tab ID of a newly opened window w/out using a background page?</p>
  
  <p>Thanks a lot in advance.</p>
  
  <p>UPD:
  I tried to inverse the logic and get a data from parent window with 'window.opener.foo()' but in a newly opened tab <code>window.opener</code> returns <code>null</code>.</p>