AshleyScirra opened a new issue #1004:
URL: https://github.com/apache/cordova-android/issues/1004


   # Feature Request
   
   As of cordova-ios 6.0.0, you can use the following in config.xml:
   
   ```xml
   <preference name="scheme" value="app"/>
   <preference name="hostname" value="localhost"/>
   ```
   Then the app runs on app://localhost instead of file://. This does not 
appear to work on Android though - having tried it the app still runs at a 
file:// URL.
   
   ## Motivation Behind Feature
   Running on file: brings a number of origin-related problems. Notably on 
file:, the browser treats every resource as a different origin, causing some 
features to be blocked. In particular, `fetch()` cannot be used at all, because 
it's actually written in to the specification that it should throw on file: 
protocol.
   
   Further, this will allow Cordova Android apps to more closely align their 
codebases with iOS, since in both cases it can be running on the same URL 
(app://localhost) with identical capabilities regarding the security origin, 
use of `fetch()`, etc.
   
   ## Alternatives or Workarounds
   Right now we are forced to use cordova-plugin-file to read local files, and 
in many cases use some ugly code involving blobs and blob URLs to work around 
restrictions with file: URLs. We also have to maintain two significantly 
different codepaths, one using `fetch()`, the other using cordova-plugin-file 
methods.


----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to