【发布时间】:2019-11-08 10:35:19
【问题描述】:
我正在尝试通过 ajax 从我的网站获取一些 json 响应,但在控制台面板中它不断抛出此错误。 从源“chrome-extension://”访问“https://website.com/ajaxrequest”处的 XMLHttpRequest 已被 CORS 策略阻止:请求的资源上不存在“Access-Control-Allow-Origin”标头。
这是我的清单
{
"update_url": "https://clients2.google.com/service/update2/crx",
"manifest_version": 2,
"version": "1.1",
"short_name": "TestApp",
"name": "My Test App",
"icons": {"128":"logo.png"},
"description": "some short desc",
"browser_action": {
"default_icon": "icon.png",
"default_title": "XYZ",
"default_popup": "index.html"
},
"permissions": ["https://wwww.website.com/*", "http://localhost/"],
"content_scripts": [{
"js": ["jquery.min.js","scripts.js"],
"matches": ["https://wwww.website.com/*"]
}]
}
【问题讨论】: