I'm using Mozilla Add-on Sdk for Firefox to create a small extension. I want to get data from several servers and display it on top left corner on user page. I don't know why, but XMLHttpRequest is not working when I'm trying to read data from servers. Maybe location origins are different and Firefox block it. please very much let me know how to do XMLHttpRequest ? or how to read data from servers with extension built with Add-on Sdk ?
XHR run from content scripts currently does not allow cross-domain requests ( this is coming in Firefox 24. In the meantime, you need to instead use the request module from your main.js file, and pass along the results to a content script via message passing. There's more detail in the docs:
For a long time now it has been possible to do cross-domain xhr requests from content scripts, please see these docs for details on how to do this.