title: I have site in the "permissions", but keep getting "Origin chrome-extension://abc is not allowed by Access-Control-Allow-Origin."
body: <p>I've started new extension basing off an older one, which I've written earlier and which is working correctly now. The scheme of doing xhr is pretty normal for Google Chrome extensions: content script calls chrome.extension.sendRequest(data, callback), and the actual cross-site request is done in the backround.html.</p>
  
  <p>Also, I'v made sure that the requested site is added to "permissions" section of manifest.json.</p>
  
  <p>However, console of the background.html displays: "... Origin chrome-extension://.. is not allowed by Access-Control-Allow-Origin."</p>
  
  <p>The question is the following: except of not having the target domain in the "permissions" (I've actually tried even  here), <strong>WHAT ELSE may cause this error</strong>?</p>
  
  <hr>
  
  <p>Here are some essential code snippets:</p>
  
  <p><strong>manifest.json:</strong></p>
  
  <pre><code>{
      "name": "Register quote",
      "version": "0.0.2",
      "permissions": [ "&lt;all_urls&gt;" ],
      "background_page" : "background.html",
      "content_scripts": [
          {
              "matches": [
                  "http://somedomain.com/*"
              ],
              "css": ["register_quote.css"],
              "js": ["jquery-1.3.2.min.js", "register_quote.user.js"]
          }
      ]
  }
  </code></pre>
  
  <p><strong>background.html:</strong> <a href="http://pastebin.com/0zLArvfA" rel="nofollow">http://pastebin.com/0zLArvfA</a></p>
  
  <p><strong>register_quote.user.js:</strong></p>
  
  <pre><code>// here's the final call, how it's prepared by the content script after all:
  chrome.extension.sendRequest({
      'action': 'sendAjaxRequest',
      'url': "http://somedomain.com/the_script.php"
      'dataStr': "is_chrome=Y&amp;ticketid=123123123&amp;user=Vladimir+Mityukov&amp;action=get_quoteids"
  }, arg_callback);
  </code></pre>
  
  <hr>
  
  <p>P.S.: forgot to mention, there is also the following error in backround.html's console:</p>
  
  <pre><code> Error in event handler for 'undefined': TypeError: Cannot read property 'length' of undefined
      at setupPageActionEvents (chrome/ExtensionProcessBindings:424:36)
      at chrome/ExtensionProcessBindings:1021:5
      at [object Object].dispatch (chrome/EventBindings:182:28)
      at Object.&lt;anonymous&gt; (chrome/EventBindings:237:25)
  </code></pre>
  
  <p>Don'e have any idea what this message means and what part of my code could cause it.. The scripts, mentioned here, are not mine.</p>