You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2020/02/24 00:29:15 UTC
[GitHub] [cordova-plugin-file] Lindsay-Needs-Sleep edited a comment on issue
#352: Accessing cdvfile:// from http://[network-url] in ajax throws CORS
policy error on Android
Lindsay-Needs-Sleep edited a comment on issue #352: Accessing cdvfile:// from http://[network-url] in ajax throws CORS policy error on Android
URL: https://github.com/apache/cordova-plugin-file/issues/352#issuecomment-590135385
@vitto32
There are a couple ways I have found to work around this::
1) Like mentioned, the deprecated cordova-plugin-file-transfer plugin
2) You can use [cordova-plugin-ionic-webview](https://github.com/miloproductionsinc/cordova-plugin-ionic-webview)
This runs/(fakes?) a local server on the device which hosts your files. I had to use this to play locally saved videos.
++ You should definitely be able to xhr/ajax request whatever you want
-- It maybe runs a local server (depends/not sure).
If you have to support ios less than 11, you have to use the 2.x version which definitely runs an actual server (on ios at least). Otherwise, 4.x on ios, does not actually run a server. I'm not entirely sure how the android implementation does it.
3) Have your app inject code (exec I believe) directly into the webview, onto your remotely hosted web page using [cordova-plugin-hostedwebapp](https://github.com/pwa-builder/ManifoldCordova).
It is not maintained but it works, (basically), you just need to select a more a active fork to use.
++ definitely no local server
++ nice way to load all the cordova files + plugin files onto your remote webpage without having to rely on cdvfile
-- you would have to rewrite your json as a js script and load it as a script I believe (so that it can be injected)
-- You have to know which scripts should be injected on which pages at build time
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org