Disabling same origin policy in Cordova 5.0.0

2.2k Views Asked by At

How can i disable same origin policy in Cordova 5.0.0? It seems to be enabled and i need to disable it for development reasons. I've tried to install crosswalk in hope of something changing but cross domain requests are still disabled. Im deploying to Android 5.1.

EDIT: I do have cordova-plugin-whitelist 1.0.0 and both <access origin="*"> and a CSP meta tag with default-src *

Also note that this problem only happens when using a remote src like <content src="http://remoteserver.com/app/index.html">. Everything works fine when content src is local like <content src="index.html">. But i need to have a remote content src to avoid having to redeploy the app every single write-run-debug cycle on a mobile device.

1

There are 1 best solutions below

1
On

I suggest you read the documentation of the cordova-plugin-whitelist plugin and about CSP.

With cordova 3.* yoy only had to configure origin from anywhere in config.xml.

With Cordova 5 you have to add cordova-plugin-whitelist plugin in your project (automatically added for new projects), configure the plugin in config.xml and configure the CSP in your html files.