Пытаюсь послать запрос на свой хост, для обработки данных, но постоянно получаю ошибку в консоли:
Access to XMLHttpRequest at 'http://localhost/index.php' from origin 'http://localhost' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
POST http://localhost/index.php net::ERR_FAILED 200
Вот мой
manifest.json:
{
"name": "Main JS",
"description": "Пользовательский скрипт с использованием JQuery",
"version": "1.0",
"manifest_version": 2,
"content_scripts": [{
"js": [
"jquery.js",
"main.js"
],
"matches": ["http://localhost/"]
}],
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
"permissions": [
"http://localhost/",
"tabs",
"storage",
"declarativeNetRequest",
"declarativeNetRequestFeedback",
"declarativeNetRequestWithHostAccess",
"webRequest",
"<all_urls>",
"webRequestBlocking"
],
"declarative_net_request": {
"rule_resources": [{
"id": "ruleset_1",
"enabled": true,
"path": "rules.json"
}]
}
}
Вот
rules.json:
[{
"id" : 1,
"priority": 1,
"action" : {
"type" : "allowAllRequests"
},
"condition" : {
"urlFilter" : "*index.php",
"domains" : ["localhosh"],
"resourceTypes" : ["main_frame"]
}
}]
Как мне исправить эту ошибку?