创建Chrome应用程序时出现Access-Control-Allow-Origin错误

时间:2014-12-18 09:40:50

标签: javascript angularjs google-chrome-app

使用angular js创建chrome app时出现此错误: XMLHttpRequest无法加载chrome-extension://macgkiieglfabdbhlomjjkfaklmgodbi/templates/home.html。请求的资源上不存在“Access-Control-Allow-Origin”标头。因此,不允许原点'null'访问。

index.html中的

我使用了这一行

 <div ui-view class="full-height-footer" id="main-container"></div>

更改视图

在清单中我指定了这个:

{
  "manifest_version": 2,
  "name": "abc",
  "version": "2.1",
  "minimum_chrome_version": "23",
  "icons": {
    "16": "icon_16.png",
    "128": "icon_128.png"
  },
  "app": {
    "background": {
      "scripts": ["main.js"]
    }
  },
  "sandbox": {
    "pages": ["index.html"]
  },
  // "offline_enabled": false,
  "content_security_policy": "script-src 'self' http://fonts.googleapis.com; object-src 'self'",
  "permissions": [
    "*://fonts.googleapis.com/*",
     "*://s3-us-west-2.amazonaws.com/jb-flashcards/*",
        "webRequest",
        "webRequestBlocking"
  ]
}

0 个答案:

没有答案