You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/10/19 17:26:02 UTC

[GitHub] [cordova-plugin-file] breminnyi opened a new issue #431: cordova.file.applciationDirectory has wrong URL scheme on windows10

breminnyi opened a new issue #431:
URL: https://github.com/apache/cordova-plugin-file/issues/431


   # Bug Report
   Field cordova.file.applicationDirectory returns wrong URL scheme for windows10 platform: `ms-appx:///` instead of `ms-appx-web:///`.
   
   ### What is expected to happen?
   Correct URL to file, that starts from `ms-appx-web:///` if platform is windows10, file is loaded successfully.
   
   
   ### What does actually happen?
   URL starts from `ms-appx:///` and file wasn't loaded.
   
   
   ### Command or Code
   Create empty cordova project: `cordova create`
   Add windows platform: `cordova platform add windows`
   Add the plugin: `cordova plugin add cordova-plugin-file`
   
   Also put access tag in config.xml file: `<access origin="*" />` (maybe it isn't necessary, IDK)
   
   Now add some code into **_www/js/index.js_** `onDeviceReady` function: 
   `var img = new Image();`
   `img.src = cordova.file.applicationDirectory + 'www/img/logo.png';`
   `var div = document.getElementsByClassName('app')[0];`
   `div.appendChild(img);`
   
   Run the application and observe the actual result.
   
   
   ### Workaround
   Replacing all occurrences `ms-appx:///` with `ms-appx-web:///` in file `cordova-plugin-file/src/windows/FileProxy.js` should fix the problem.
   But I'm interested in proper fix.
   
   
   ### Environment, Platform, Device
   windows10
   
   
   ### Version information
   Cordova CLI version:
   `9.0.0 (cordova-lib@9.0.1)`
   Plugin version:
   `cordova-plugin-file 6.0.2 "File"`
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org