title: chrome.extension.getBackgroundPage is undefined in an extension page in an iframe
body: <p>I am trying to access my extension's background page using <code>chrome.extension.getBackgroundPage</code> function.</p>
  
  <p>However, I get the following error:</p>
  
  <blockquote>
    <p>Uncaught TypeError: chrome.extension.getBackgroundPage is not a function</p>
  </blockquote>
  
  <p>I am calling the function from my <code>bar.js</code> file which is defined as a <code>web_accessible_resource</code> in my <code>manifest.json</code></p>
  
  <p>How do I make it work?</p>
  
  <p><strong>manifest.json</strong></p>
  
  <pre><code>{
    "manifest_version": 2,
    "name": "XPath Helper",
    "version": "1.0.13",
    "description": "Extract, edit, and evaluate XPath queries with ease.",
    "background": {
      "page": "background.html"
    },
    "content_scripts": [
      {
        "matches": ["&lt;all_urls&gt;"],
        "css": ["content.css"],
        "js": ["content.js"]
      }
    ],
    "permissions": ["http://*/", "tabs", "identity", "identity.email"],
    "icons": {
      "32": "static/icon32.png",
      "48": "static/icon48.png",
      "128": "static/icon128.png"
    },
    "web_accessible_resources": [
      "bar.css",
      "bar.html",
      "bar.js"
    ]
  }
  </code></pre>
  
  <p><strong>bar.js</strong> is a script inside <code>bar.html</code> (<em>not</em> a content script):</p>
  
  <pre><code>// ...
  
  document.addEventListener('DOMContentLoaded',function(){
    // previosuly chrome.extension.getBackgroundPage()
    chrome.runtime.getBackgroundPage(function(page){
      alert("hello");
    })  
  })
  </code></pre>
  
  <p><strong>content.js</strong></p>
  
  <pre><code>// ...
  
    this.barFrame_ = document.createElement('iframe');
    this.barFrame_.src = chrome.extension.getURL('bar.html');
  
    document.body.appendChild(this.barFrame_);
  
  // ...
  </code></pre>