cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filip Maj (JIRA)" <>
Subject [jira] [Commented] (CB-13044) Update cordova-plugin-file to latest version of File API
Date Wed, 02 Aug 2017 22:14:00 GMT


Filip Maj commented on CB-13044:

OK, I've done some testing inside cordova-ios and cordova-android for the latest File API
spec and how the native implementations in the webview stack up against web form tests.

tl;dr iOS 10+ is fine. iOS 9.3 is fine-ish. Android 5.1+ is fine. Android 5.0 is meh. Android
4.4 starts really shitting the bed.

The spreadsheet with the breakdown is here:

I used the W3C's web-platform-tests as the test suite - on my fork, there's a cordova-testing
branch I used: Ensure to
follow README if you want to test this on your end (which involves tweaking your /etc/hosts
file), you'll need to set up a config.json file w/ local hosting details such as the IP to
bind to (this can tricky if you are testing on a real device: need to use a wifi internal
IP address accessible to both laptop and device. To test on an Android emulator, you will
want the server to bind to localhost).

The test app I used is this:

Always make sure to tweak the config.xml for the above project, especially with respect to
the IPs under the <content> and <allow-*> tags, since the shell app doesnt do
much more than load the URL of the web-platform-tests. This is non-intuitive with an Android
emulator as your machine's 'localhost' address is accessible at the IP in an Android
emulator. On an iOS sim, localhost works just fine.

In conclusion, I still think we will need the JS for the new version of the File API around.

> Update cordova-plugin-file to latest version of File API
> --------------------------------------------------------
>                 Key: CB-13044
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Task
>          Components: cordova-plugin-file
>            Reporter: Filip Maj
>              Labels: plugins-next
> Part of the roadmap for the core plugins is to update them to make them spec-relevant
once more. See CB-12715.
> After taking a look at the current version of [W3C File API|],
here is one take on what specific API changes are needed to update the API to the current
> - *remove* a bunch of APIs, specifically:
> -- everything to do with the [old (now discontinued) File System API|]:
> --- {{window.requestFileSystem}} method
> --- {{LocalFileSystem}} object
> --- {{FileSystem}} object
> --- {{Flags}} object
> --- {{Metadata}} object
> --- {{Entry}}, {{DirectoryEntry}} and {{FileEntry}} objects
> --- {{DirectoryReader}} object
> -- everything to do with the [old, discontinued File Writer API|]:
{{FileWriter}} object
> -- {{FileUploadOptions}}, {{FileUploadResult}} objects (wtf are these? I think they are
for supporting file transfer? why are they in plugin-file? lol?)
> -- the {{FileError}} object, as the [latest spec says to return {{DOMException}}|]
> - update a bunch of APIs, specifically:
> -- update {{FileReader}} interface's {{readAs*}} methods so that they take a {{Blob}}
object instead of a {{File}} object as parameter
> -- if the polyfill is still needed, might need to update the {{File}} object and remove
a bunch of extra native-y cruft like "type" and stuff that was used when leveraging the bridge
> -- update any error handling to return {{DOMException}} instances instead of the now-removed
> - possibly write up a polyfill for {{Blob}} ? Looks like it will be needed in Android
4.4 or lower.
> - possibly write up a polyfill for {{FileList}} (as per [spec|])
- might be needed on iOS 9.3 / Android 4.4. Worth noting that the first descriptive text in
the spec mentions this interface being "at risk" as it's basically a glorified array.
> - review docs:
> -- are referencing local file system paths like {{<img src="cdvfile://filesystem/path">}}
still relevant (related to open question #2 below)?
> -- review and update
- it mentions some things like indexeddb has a 5MB storage, we should probably update it to
mention it is supported in ios, and do some quick checking on max storage size.
> -- remove
> -- how much of this documentation should reside in the File plugin docs vs. in the general
"Storage" cordova docs, or perhaps even the platform docs? over half of the File plugin docs
talk about filesystem formats and platform quirks therein.
> A few open questions:
> 1. One thing worth noting is that platform implementations for a lot of the above may
not be needed on iOS 10+ and Android 5.0+. Would need to check windows / edge support. If
support is splotchy, we need to keep in mind to write the plugin in such a way that we don't
clobber over potentially-pre-existing spec-adhering objects of the File API.
> 2. Worth calling out that the [File API defines its own URL scheme to use|].
Does this then supercede the cordova custom ones like cdvfile:// and other protocols?

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message