Skip to content Skip to sidebar Skip to footer

Can't Do HTTP Request With My Chrome Extension

For some reason, I keep getting the following error when I try to use my chrome extension; Refused to load the script 'http://dynamic.xkcd.com/api-0/jsonp/comic/1123?callback=rand

Solution 1:

You shouldn't use jsonp from an extension, as it involves execution of code provided by the server, and that's what the error is about. You can access the json directly using:

url: "http://xkcd.com/"+ x +"/info.0.json",

Remember to update the permissions in your manifest to allow this host. And remove the jsonpCallback field from your parameter.


Post a Comment for "Can't Do HTTP Request With My Chrome Extension"