[英]Google Chrome Extension error - Access-Control-Allow-Origin
XMLHttpRequest cannot load http://localhost:4567/save . XMLHttpRequest无法加载http:// localhost:4567 / save 。 Origin chrome-extension://cbemaelkkmebiohhjgmlclegalijdbbh is not allowed by Access-Control-Allow-Origin.
原始chrome-extension:// cbemaelkkmebiohhjgmlclegalijdbbh不允许使用Access-Control-Allow-Origin。
Even thought I'm getting this error the extension seems to be calling the URL. 即使我认为我收到此错误,扩展似乎是调用URL。 The message passing from contentscript.js to background.html took me a few minutes to wire up, but seems ok.
从contentscript.js传递到background.html的消息花了我几分钟接线,但似乎没问题。 I'm confused.
我糊涂了。
Here is my manifest. 这是我的清单。
{
"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/*" ]
}
Try changing http://* to http://*/ (and removing the localhost entry). 尝试将http:// *更改为http:// * /(并删除localhost条目)。
If you're trying to access a https page, you will need that too. 如果您尝试访问https页面,也需要这样做。
将"http://*"
替换为"<all_urls>"
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.