This code allows me to request my backend through HTTP, but my websocket is still blocked by the content security policy. I tried several combinaisons and workaround to add ws://localhost:3000 to that list but nothing worked. Since this webpage makes no mention of websockets support, I start to wonder if there is a way do that.
In wikipedia (https://en.wikipedia.org/wiki/Content_Security_Policy), it even says that Addon should be exempted from CSP. But this turns out not to be the case for Firefox.
In Chrome, however, I can make things work. The websocket open inside Facebook.com, who implements CSP, to my localhost works fine. But in Firefox it doesn’t.
So I suppose this is an issue for Firefox.
As I commented in the SO topic, using page-worker is another workaround so you can still use proper WebSockets. It’d be worth testing if this also happens for web-ext.