Submit data via jquery post to another website

When I try to submit data from addon to an external website using jquery post from content_scripts I get this error:

Content Security Policy: The page’s settings blocked the loading of a resource at https://www.test.com/ (“connect-src”).

I understand that this type of error can be fixed using background js, but I can’t find any example or information how exactly to do this.

Anyone can help me with an example please?

Thank you.

Assuming that jQuery uses XHRs, you should be able to POST from a content script, if you have a host permission for the target:


At least one would hope that the pages CSP doesn’t interfere with this.

Addon is running on facebook website. Using XMLHttpRequest I don’t have that error, instead in both cases action is not made on target website, in console I have a call request to https://www.facebook.com/ajax/bz