Morgan
Morgan

Reputation: 95

socket.io on a distant node server in a google chrome extension

I'm working on a chrome extension, and I'm trying to connect to my node server through socket.io (in my background script) but I can't load the socket.io.js on my server... I get a :

Refused to load the script 'http://myhost:8080/socket.io/socket.io.js' because it violates the following Content Security Policy directive: "script-src 'self' chrome-extension-resource:".

So and I started to search the web, and I'm kind of stuck. Is it even possible to do such a thing ? How could I communicate with my server if not ? Please, any help much appreciated :)

Upvotes: 1

Views: 596

Answers (1)

Florian Margaine
Florian Margaine

Reputation: 60717

Yes, it's possible. You just need to specify some directives in your manifest.json:

"content_security_policy": "default-src 'none'; script-src 'self'"

Upvotes: 1

Related Questions