I create simple google chrome extension and I get JSON data but this error is generated
dashboard.html:1 Access to XMLHttpRequest at 'https://humane-like-developer-edition.ap4.force.com/services/apexrest/SessionHuman' from origin 'chrome-extension://dgbedclgdamcknolmpacbbigocadoiko' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
This is my code
var HttpClient=function()
{
this.get=function(aUrl,aCallback)
{
var anHttpRequest=new XMLHttpRequest();
anHttpRequest.onreadystatechange=function()
{
if(anHttpRequest.readyState==4 && anHttpRequest.status==200)
{
aCallback(anHttpRequest.responseText);
}
}
anHttpRequest.open("GET",aUrl,true);
anHttpRequest.send(null);
}
}
var theurl='https://humane-like-developer-edition.ap4.force.com/services/apexrest/SessionHuman';
var client=new HttpClient();
client.get(theurl,function(response){
alert(response);