Back to Cordova

2021 06 06

slack-digest/2021-06-06.md

latest1.9 KB
Original Source

Cordova Slack Digest

Sun, 06 Jun 2021 08:28:54 GMT

User count: 4517

Join the conversation at slack.cordova.io

Channel #general (1 messages)


Sat, 05 Jun 2021 20:06:48 GMT

@costagauci says

Hi all, I have created an app and I am having trouble with the Content Security Policy. When testing everything works fine on Android however when for iOS it doesn't seem to work.

I am getting the following error:

Origin
XMLHttpRequest cannot load <https://webaddress.org.uk/location/login.php> due to access control checks.
Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin.```
This is the relevant code. I am really baffled here.

```&lt;meta http-equiv="Content-Security-Policy"
		content="default-src * data: cdvfile: gap:;
		style-src 'self'  <https://webaddress.org.uk/*>
						  <https://locations.webaddress.org.uk/*>;
		script-src 'self' <https://webaddress.org.uk/*>
						  <https://locations.webaddress.org.uk/*> 'unsafe-inline' 'unsafe-eval'"&gt;```
```    &lt;content src="index.html" /&gt;
	&lt;access origin="*" /&gt;
	&lt;allow-intent href="<http://thepod.org.uk/*>" /&gt;
	&lt;allow-intent href="<https://thepod.org.uk/*>" /&gt;
	&lt;allow-intent href="http:/locations.thepod.org.uk/*" /&gt;
	&lt;allow-intent href="<https://locations.thepod.org.uk/*>" /&gt;
	&lt;allow-intent href="tel:*" /&gt;
	&lt;allow-intent href="sms:*" /&gt;
	&lt;allow-intent href="mailto:*" /&gt;
	&lt;allow-intent href="geo:*" /&gt;
	&lt;platform name="android"&gt;
		&lt;allow-intent href="market:*" /&gt;
	&lt;/platform&gt;
	&lt;platform name="ios"&gt;
		&lt;allow-intent href="itms:*" /&gt;
		&lt;allow-intent href="itms-apps:*" /&gt;
	&lt;/platform&gt;```
I am using cordova-plugin-whitelist