views:

305

answers:

1

Has anybody had any luck performing cross origin XHRs from a user script in Google Chrome? The requests go through to the server (I cann see them in the logs) but, the readystatechanged event is never fired.

Extension permissions don't seem to be doing the trick. Neither is jsonp.

+4  A: 

Hi Pranav,

A user script in Chrome is a content script. Content scripts cannot make cross-origin XHRs. If you wish to do cross-origin XHRs, it should be done in the extension pages (background, popup, options).

For more info: http://code.google.com/chrome/extensions/content%5Fscripts.html http://code.google.com/chrome/extensions/xhr.html

Mohamed Mansour

related questions