My Cordova/Phonegap app is encountering an issue while trying to retrieve certain files using AJAX. The specific error message that I receive states:
XMLHttpRequest cannot load https://docs.google.com/uc?export=open&id=.... Redirect from 'https://docs.google.com/uc?export=open&id=...' to '' 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.
In an attempt to resolve this issue, I have made modifications to the config.xml
file:
<access origin="*" />
<allow-navigation href="*" />
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
I have also included additional code in the index.html
file:
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: 'unsafe-eval' 'unsafe-inline' http: https:">
Despite making these changes, the error persists even when accessing the application through a browser with cordova serve
. Any suggestions or insights on how to resolve this issue?