title: Chrome Packaged apps not working with jquery and jquery mobile
body: <p>Using jQuery 1.10.2 and jQuery Mobile 1.3.2 I am trying to create a chrome packaged app with the following simple html...</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
      &lt;div data-role="page"&gt;
          &lt;script async src="events.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>There are two problems. The first is that jQuery will intercept the script tag loading events.js and makes the call xhr.open( s.type, s.url, s.async ); however s.async is false. Chrome packaged apps do not allow synchronous loading. So before this line in jQuery i set s.async = true;</p>
  
  <p>The next problem is that jquery will call its globalEval method on each script on first document insertion and this calls eval which produces this CSP error with the chrome packaged app:</p>
  
  <p>Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "default-src 'self' chrome-extension-resource:".</p>
  
  <p>One solution might be sandboxing (add the html page in the manifest) however this causes another problem:
  XMLHttpRequest cannot load chrome-extension://ocnbknafegfhcgbiciegbfndjckamkoj/events.html. Origin null is not allowed by Access-Control-Allow-Origin.
  The server has "Access-Control-Allow-Origin", "*" so i wouldn't expect this error.</p>
  
  <p>So, is the first sync error a jquery problem? 
  Is the second problem also jquery/chrome packaged app mismatch? 
  Is there are workaround for CSP?
  Is there a way to sandbox but allow navigation between pages?</p>