cordova - Cross origin request fails even though both CSP and <access origin=''> are set -


im using cordova 5.0.0 , cordova-plugin-whitelist 1.0.0 , im deploying android 5.1 on nexus 5 phone.

this config.xml looks (note im using remote source in content tag (as in not local phone), dont know if thats relevant or not):

<access origin="*" /> <access origin="http://remotedomain.com" /> <content src="http://localdomain.com/app.html" /> 

edit: content src relevant! tried running app local source setting <content src="app.html"> , works! hmm. impossible use remote src? i'd during development allows faster write run debug cycle.

this csp looks like:

<meta http-equiv="content-security-policy" content="default-src 'self' remotedomain.com www.remotedomain.com * 'unsafe-inline'"> 

i know, vulnerable. im testing , want see working first step.

my problem: xhrs remotedomain.com blocked chrome. see in chrome console connect phone using chrome://inspect/#devices

xmlhttprequest cannot load http://remotedomain.com/resource. no 'access-control-allow-origin' header present on requested resource. origin 'http://localdomain.com' therefore not allowed access. 

i have no control on remotedomain.com , there no jsonp or cors, html page. how can make xhrs app?

edit: content src relevant! tried running app local source setting <content src="app.html"> , works! hmm. impossible use remote src? i'd during development allows faster write run debug cycle.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -