Situation: autoreload of phonegap serve
blocked by content-security-policy meta tag
Adding content security policy prevents auto-reload of phonegap serve
utility. This is built on top of cordova serve
but auto-reloads the app on file editing. It works by injecting socket.io
in index.html
. What should I specify in my CSP meta tag that will allow socket connections to my laptop.
Here is my current CSP meta tag:
<meta http-equiv="Content-Security-Policy" content="default-src 'self' 192.168.0.100 * ws:* ; connect-src ws://192.168.0.100 ws:*">
However on opening, the device keeps showing "Connecting to device" and not event is received on the device.
Also note that it starts working on removing this meta tag which mean the cordova-plugin-whitelist
might not be blocking it.