Currently, I am running a content script whenever https://twitter.com/home loads. The content script makes a POST request to my own API server (hosted on AWS) in the content script, using Axios. But I run into the following error:
Access to XMLHttpRequest at '${endpoint url}' from origin 'https://twitter.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I've only just started building chrome extensions so I'm probably doing it completely wrong. Please correct me and let me know how a feature like this could be implemented.
You have 2 options:
Access-Control-Allow-Origin
header for example.Further reading can be found here .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.