开发者

Running a JS method once to initiate variable when the chrome extension is loaded once?

I开发者_如何学编程 need to load a var by getting JSON from a webservice, so my question is where does this code go? I tried to put it in the content script but XHR would fail there. Any suggestions?


Starting from Chrome 13 content scripts can also perform XHR requests (before only background pages could). So you can put your code wherever you like.

If it doesn't work then you probably didn't specify domain permissions (or trying to connect to non-80 port, to non-http(s) protocol etc).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜