What is the best practices for retrieving data from cross origin JSONP API with Origin header restriction?
The website it self use JSONP to fetch some data from its backend. I want to perform the same action in my WebExtension content script. What I have tried:
- Access JSONP API data using
fetch()
API and parse the result- It failed because Origin HTTP request header is not set. The website refuse to return result in such case.
- Access JSONP API data using
content.fetch()
- The request is blocked due to CORS policy
- I’m not sure if it is possible to work it out on background script, but it will lose contextual identities information
So what should I do then?