I have a Cordova/Phonegap application trying to get some files with AJAX. I get the following error:
XMLHttpRequest cannot load https://docs.google.com/uc?export=open&id=.... Redirect from 'https://docs.google.com/uc?export=open&id=...' to 'https://doc-xx-xx-docs.googleusercontent.com/docs/...?e=open' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
I tried adding the following to config.xml
<access origin="*" />
<allow-navigation href="*" />
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
and also added to index.html
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: 'unsafe-eval' 'unsafe-inline' http: https:">
I'm accessing the application in the browser using cordova serve
.
I still get the same error. Any idea?