flojug edited a comment on issue #334: Electron platform - 'Missing Command 
Error' on API calls
URL: 
https://github.com/apache/cordova-plugin-file/issues/334#issuecomment-545402772
 
 
   **cordova.platformId = 'electron'
   Linux x64, Debian 10**
   
   My app is running well on iOS, Android, Chrome browser.
   
   It downloads images from a remote server and then uses them in a canvas.
   
   1/ With 
   `if (cordova.platformId === "browser" && require('./isChrome')()) {`
   in 
   ```
   FileProxy.js
   requestFileSystem.js
   requestFileSystem.js
   ```
   
   ```
   $ rm -rf ~/.config/Electron
   $ cordova run electron --nobuild
   ```
   
   The download of images is OK.
   In my code I have : 
   ```
   img = new Image();
   img.onload = imageLoaded;
   img.src = filepaths.shift();  
   ```
   which results in :
   `GET file:///persistent//forms/form_200065_victime_0.png 
net::ERR_FILE_NOT_FOUND`
   
   2/ If I replace 
   `if (cordova.platformId === "browser" && require('./isChrome')()) {`
   with 
    ` if (((cordova.platformId === "browser") || (cordova.platformId === 
"electron")) && require('./isChrome')()) {`
   in 
   ```
   FileProxy.js
   requestFileSystem.js
   requestFileSystem.js
   ```
   (i.e use Chrome layer for manipulation of files in Electron)
   
   Then 
   ```
   $ rm -rf ~/.config/Electron
   $ cordova run electron --nobuild
   ```
   Everything is working fine.
   
   
   
   
   

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


With regards,
Apache Git Services

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

Reply via email to