I'm trying to play around with a basic chrome extension which goes 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'm getting the following error. I'd appreciate any help :)
Refused to load the script 'http://sample.com' because it violates the following Content Security Policy directive: "script-src 'self' chrome-extension-resource:".
You should read about Content Security Policy
complete your manifest file with:
"content_security_policy": "script-src 'self' http://sample.com; object-src 'self'",
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With