Hello, I'm creating a chrome extension that loads a java script on some specific pages and gets data from API and does some things etc. But the API blocks no-cors. I searched for it and found something, but it still doesn't work ..
What I found:
let headers = new Headers()
headers.append('Content-Type', 'application/json');
headers.append('Accept', 'application/json');
headers.append("Origin", "https://myapi.com/")
headers.append("Access-Control-Allow-Headers", "Content-Type", "Authorization");
headers.append("Access-Control-Allow-Methods", "GET", "POST", "OPTIONS");
headers.append("Access-Control-Allow-Origin", "https://myapi.com/");
fetch("https://myapi.com/", {
mode: 'cors',
method: 'GET',
headers: headers
}).then(...)