I am trying to make a call to this site and receive a json object back. How can I interface with this API properly within my chrome extension given CSP?
Error: Refused to load the script 'http://thesaurus.altervista.org/service.php?word=smile&language=en_US&output=json&key=REMOVEDMYKEY&callback=thesaurus' because it violates the following Content Security Policy directive: "script-src 'self' chrome-extension-resource:".
var word = "smile";
var s = document.createElement("script");
s.src = "http://thesaurus.altervista.org/service.php?word="+ word +"&language=en_US&output=json&key=REMOVEDMYKEY&callback=thesaurus";
document.getElementsByTagName("head")[0].appendChild(s);
function thesaurus(result) {
output = "";
for (key in result.response) {
list = result.response[key].list;
output += list.synonyms+"<br>";
}
if (output)
document.getElementById("synonyms").innerHTML = output;
}