Should 'ionic run browser' work with cordova-plugin-file?

I’m trying to debug file handling inside my app by running it in the browser with ‘ionic run browser’. but it seems that the cordova.js doesn’t really provide a file system emulation as i can’t seem to get a file to write anywhere. console.log(JSON.stringify(this.file)) produces:


So it seems it’s more of a dummy object. Is there a way to debug file system things with the browser? I don’t really like recompiling the whole app and transferring it to a physical device as my dev server is remote…

Thanks for any pointers here

browser isn’t a real platform and should be avoided.

For something like that you are going to have to either use the emulator/simulators or go real device. You could insert Ionic Deploy into your app to allow for faster redeploys.

1 Like

i was afraid you’d say that. hoped that the cordova ppl would have built some filesystem functions to at least test basic dataDirectory file creations etc. . thankx

The browser is sandboxed from the file system (for the most part). You can look at using my Ionic Native Mocks to help you out:

Curiosity called me and I started to read the plugin docs. It seems the only truly cross-platform way to handle files with the plugin is using the cordova.file.tempDirectory feature. At expense, of course, of some degree of vulnerability.