-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improvements to be able to work with the library in the browser #1
Comments
Cool! Thanks for creating this issue. Can you provide a code snippet for 2? (i.e. update this fiddle) |
I left an example at Just If you launch chrome with |
just an update - i am busy doing other (paid) work and not sure when I will come around to fix this. At best, end of this week. At worst, in a few weeks. |
Hi - it's already March now and I'm too busy for feature requests. If you can submit a PR, I'll merge, but otherwise, this will have to wait until I have more time. |
My apologies for the late response, I was out of the country and didn't Right now I'm quite busy in another project and unfortunately I won't have Again, I wanted to thank you for your wonderful work with the library, it Best regards. On 17 March 2015 at 20:24, Mark Marijnissen notifications@github.com
|
I'm developing a Cordova application and wanted to be able to debug it without a device (using the browser platform). I finally managed to get it working but had to perform several steps:
I had to force the isCordova check to false in order to be able to work with the library. Otherwise I received the following error (
Could not get Cordova FileSystem: FileError {code: "Missing Command Error"}
)I also needed to explicitly request file quota to be able to work with persistent storage. I did it by executing
webkitStorageInfo.requestQuota(webkitStorageInfo.PERSISTENT, options.storageSize);
after the fs initialization.In order to be able to correctly save downloaded binary files I had to set the respose type of the xhr fnction to blob (
xhr.responseType='blob';
) andwrite(file,xhr.response).then(win,fail);
. In my tests it worked for every file type, but it could be changed to work with text, array, etc, depending on the options passed to the download function.Finally, I had to launch chrome with the flags
--disable-web-security --allow-file-access-from-files --user-data-dir=datadir
and manually allow file storage in the browserI think it would be great to be able to configure the behaviour for the items 1,2,3 in the options of CordovaPromiseFS.
In any case, many thanks as cordova-promise-fs it is a wonderful library :)
The text was updated successfully, but these errors were encountered: