title: Chrome extension: create tab from within an iframe in popup
body: <p>In my popup page I've an iframe tag which has a button in it. When this button is clicked a function, that is included in the iframe's script, is called. This function contains a call to <code>chrome.tabs.create({ url: "..."});</code>, but I keep getting <em>"Uncaught TypeError: Cannot call method 'create' of undefined".</em> I guess the reason is that I'm in the iframe, not in the popup page itself.</p>
  
  <p>Is there a way to overcome that obscure and create a new tab from within the iframe?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here is my code.</p>
  
  <p>The following is loaded into the iframe of the popup page:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  
  &lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
    &lt;link rel="stylesheet" type="text/css" href="style/frame_style.css" media="screen" /&gt;
    &lt;script src='jquery-1.8.3.js'&gt;&lt;/script&gt;
    &lt;script src='scripts/frame_functions.js'&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;div&gt;
      &lt;button value="Click to open Google in a new tab" class='new_tab_bt'&gt;&lt;/button&gt;
    &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>frame_functions.js:</p>
  
  <pre><code>$(document).on("click", '.new_tab_bt', function(){
    openNewTab(); 
  });
  
  function openNewTab()
  {
  chrome.tabs.create({ url: "https://www.google.com" });
  }
  </code></pre>