I was in the process of answering this question
to load an unpacked extension goto
about:debugging#/runtime/this-firefox
Well the test in question was on a webpage protected with a content-security-policy, create a websocket
to a local server ( or other )
And the code to connect onto it
so, we can bypass the content-security-protocol header with a mitm proxy and remove the header before sending it to the
browser
chrome --proxy-server="http://127.0.0.1:8080"
for firefox, you set a proxy by going to Settings → General → Network Settings → Settings…, then choosing Manual proxy configuration and entering your proxy details
this mitm proxy requires a x.509 key and certificate, they can be generated
by connecting onto the server below we can check the actual input and output of the mitm proxy, should you wish to adapt the code, its always good to be able to check exactly what is happening
The original question identified that they opened dev tools and then pasted in the websocket client code, to be able to run the code