jQuery.ajax call fails inside Chrome extension

前端 未结 4 1532
时光说笑
时光说笑 2020-12-28 21:56

I\'m porting one of my Firefox extensions to Chrome, and I\'m running into a little problem with an AJAX query. The following code works fine in the FF extension, but fails

4条回答
  •  隐瞒了意图╮
    2020-12-28 22:40

    As you figured out Chris, in Content Scripts, you can't do any Cross-Domain XHRs. You would have to do them in an extension page such as Background, Popup, or even Options to do it.

    For more information regarding content script limitation, please refer to: http://code.google.com/chrome/extensions/content_scripts.html

    And for more information regarding xhr limitation, please refer to: http://code.google.com/chrome/extensions/xhr.html

提交回复
热议问题