I'm trying to play around with the basic chrome extension, which looks something like this.
chrome.omnibox.onInputChanged.addListener(function(text, suggest){
var baseUrl = "http://sample.com";
var finalResult = [];
$.ajax({
url : baseUrl,
dataType : "jsonp",
success: function(result) {
for (var i=0; i<result[1].legnth; i++){
finalResult.push(
{content : result[1][i], description : result[1][i]}
);
}
suggest(finalResult);
},
async: false
});
});
This works with manifest version 1, but when I change it to v2, I get the following error. I would be grateful for any help :)
Refused to download script 'http://sample.com' because it violates the following content security policy directive: "script -src 'self' chrome-extension-resource:".
source
share