Chrome XHR extension not working

:)

I upload Chrome to Facebook and I make a simple jQuery GET request to my own website. I get the following error in the console when a GET request is called ...

"Refused to connect to 'https://www.istyla.com/Popup/t2.php' because it violates the following Content Security Policy directive: "connect-src https://*.facebook.com http://*.facebook.com https://*.fbcdn.net http://*.fbcdn.net *.facebook.net *.spotilocal.com:* https://*.akamaihd.net ws://*.facebook.com:* http://*.akamaihd.net"." 

It happened all of a sudden. Yesterday he worked ...

Here is part of my manifest Chrome extension with the CSP definition :

 "content_security_policy": "default-src 'self'; script-src 'self'; object-src 'self'; connect-src *" 

Here is my GET request (downloadable via content script). JQuery also loads as a separate content script):

 $.get("https://www.istyla.com/Popup/t2.php" + c, function (d) { //do my other stuff here } 

By the way ... t2.php allows all origin. Is it Facebook that installs CSP on its website? What can I do to connect to my URL via jQuery GET?

Thanks for any advice ... :)

+4
source share
2 answers

I had the same problem with my script. I moved all my AJAX calls to a background script.

+4
source

I think direct .get will not work in cross domain. Can you try using $ .jsonp. http://www.jquery4u.com/json/jsonp-examples/

-3
source

All Articles