使用Firefox的插件创建跨网域ajax请求

问题描述:

我有点困惑,如何你可以或不能在Firefox的addons中做跨域的ajax请求。像LastPass和Xmarks这样的插件提示你可以这样做,但是当我尝试google时,大家似乎都说你不能,除非用户在Firefox的设置中设置了首选项。如果不能使用跨域,那么Xmarks,LastPass和其他插件如何处理与其各自服务器的通信?

I'm a bit confused about how you can or cannot make crossdomain ajax requests in addons for Firefox. Addons such as LastPass and Xmarks suggest you can do it, however when I try to google how you do it, everyone seem to say you cannot, unless the user has set a preference in the settings of Firefox. If crossdomain isn't possible, then how do Xmarks, LastPass and other addons handle the communication with theirs respective servers?

最肯定可以在Firefox附加组件中创建跨域 XMLHttpRequest

You most definitely can make cross-domain XMLHttpRequests in Firefox add-ons.

这里有一个引用: https://developer.mozilla.org/en/Extension_ Frequ_Asked_Questions#I_cannot_initiate_an_XMLHttpRequest_from_my_extension