2011-05-17 59 views
2

XMLHttpRequest無法加載http://localhost:4567/save。來源chrome-extension:// cbemaelkkmebiohhjgmlclegalijdbbh不被Access-Control-Allow-Origin允許。谷歌瀏覽器擴展程序錯誤 - 訪問控制 - 允許來源

甚至認爲我得到這個錯誤的擴展似乎是調用的URL。從contentscript.js傳遞到background.html的消息讓我花了幾分鐘時間來連接,但似乎沒問題。我很困惑。

這是我的清單。

{ 
    "name": "FirstExt", 
    "version": "1.0", 
    "description": "My First Extension", 
    "browser_action": { 
    "default_icon": "icon.png", 
    "popup": "popup.html" 
    }, 
    "content_scripts": [ 
    { 
    "matches": ["http://*"], 
    "js": ["jquery.min.js", "contentscript.js"] 
    } 
    ], 
    "background_page": "background.html", 
    "permissions": [ "http://*", 
       "http://localhost:4567/*" ] 
} 
+0

注意:我還沒有真正使用popup.html。它是空的。 – BuddyJoe 2011-05-17 18:08:57

回答

10

嘗試改變的http:// *爲http:// * /(和刪除localhost項目)。

如果您嘗試訪問https頁面,您也需要這樣做。

8

"http://*"替換爲"<all_urls>"

+0

您需要在上傳擴展程序之前刪除它嗎? – Jeremy 2011-12-22 19:29:27

+1

編號[填充文字] – 2011-12-22 21:30:14

+2

對於請看http://code.google.com/chrome/extensions/match_patterns.html – 2012-02-28 23:06:35

相關問題