title: Using sandboxed pages in chrome extensions
body: <p>Manifest version 2 of chrome extensions will no longer support use of <strong>eval</strong> or <strong>new Function</strong> on regular extension pages. My chrome extension uses a UI Framework (Kendo UI) on the options page that makes use of these mechanisms and therefore I'm looking for a solution.</p>
  
  <p>According to <a href="https://developers.google.com/events/io/sessions/gooio2012/208/" rel="nofollow">this session</a> from IO 2012 the idea is to put the corresponding page into a sandbox and load it into the extension via an iframe.</p>
  
  <p>Here is a simplified example what I'm trying to do: <a href="https://gist.github.com/3058943" rel="nofollow">https://gist.github.com/3058943</a></p>
  
  <p>manifest.json:</p>
  
  <pre><code>{
   "name": "Sandbox test",
   "manifest_version": 2,
   "options_page": "main.html",
   "sandbox": {
      "pages": [ "index.html" ]
    }
  }
  </code></pre>
  
  <p>main.html:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;&lt;/head&gt;
    &lt;body&gt;
      &lt;iframe id="iframe" src="index.html" &gt;&lt;/iframe&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>index.html:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;&lt;/head&gt;
    &lt;body&gt;
      &lt;h1&gt;Inside the sandbox&lt;/h1&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I load the options page in this example, I'm getting the error message:</p>
  
  <blockquote>
    <p>Denying load of chrome-extension://fahdnpkbgfjkocogbjlljfbhnljcehoh/index.html. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by web pages.</p>
  </blockquote>
  
  <p>I don't think that each sandboxed page is also supposed to be a web_accessible_resources.
  But even when I try to define the sandboxed pages also as web_accessible_resources in the manifest file, then the sandboxed page gets loaded but use of <strong>new Function</strong> inside the iframe is still blocked.</p>