Using jQuery.getJSON in Chrome Extension

后端 未结 5 798
遥遥无期
遥遥无期 2020-12-30 13:54

I need to do a cross-domain request in a chrome extension. I know I can it via message passing but I\'d rather stick to just jQuery idioms (so my javascript can also work as

5条回答
  •  情歌与酒
    2020-12-30 14:26

    As many of you will know, Google Chrome doesn't support any of the handy GM_ functions at the moment.

    As such, it is impossible to do cross site AJAX requests due to various sandbox restrictions (even using great tools like James Padolsey's Cross Domain Request Script)

    I needed a way for users to know when my Greasemonkey script had been updated in Chrome (since Chrome doesn't do that either...). I came up with a solution which is documented here (and in use in my Lighthouse++ script) and worth a read for those of you wanting to version check your scripts:

    http://blog.bandit.co.nz/post/1048347342/version-check-chrome-greasemonkey-script

提交回复
热议问题