Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jkleinsc/polypolyfile
What happens you try to use the FileSystem API polyfill on top of the IndexedDB polyfill?
https://github.com/jkleinsc/polypolyfile
Last synced: 11 days ago
JSON representation
What happens you try to use the FileSystem API polyfill on top of the IndexedDB polyfill?
- Host: GitHub
- URL: https://github.com/jkleinsc/polypolyfile
- Owner: jkleinsc
- License: mit
- Created: 2013-07-17T14:40:42.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-08-22T04:16:20.000Z (over 11 years ago)
- Last Synced: 2024-10-27T16:28:00.426Z (about 2 months ago)
- Language: JavaScript
- Size: 227 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PolypolyFile
============What happens you try to use the FileSystem API polyfill on top of the IndexedDB polyfill?
![alt tag](http://jkleinsc.github.io/PolypolyFile/polypoly.jpg)You get the following demo: http://jkleinsc.github.io/PolypolyFile
1. There is a polyfill for the FileSystem API (//github.com/ebidel/idb.filesystem.js/), that relies on IndexedDB.
2. There is a polyfill for the IndexedDB API that relies on WebSQL (https://github.com/axemclion/IndexedDBShim).
3. Can you use polyfill #1 on top of polyfill #2?
4. If you can, the FileSystem API can be used in most browsers, including Safari and mobile Safari(iOS).When I started this project, it turned out that the IndexedDB polyfill simply used
JSON.stringify/JSON.decode to mimic the Structured Cloning Algorithm. This meant
that the FileSystem polyfill didn't work because it was using Blobs to save the files
in the IndexedDB. Blobs get converted to null when you attempt to convert them using JSON.stringify.After examining the IndexedDB polyfill, I decided to properly implement the Structured
Cloning Algorithm for that polyfill. That implementation has been accepted as a pull
request for the IndexedDB polyfill: GitHub pull requestWhat you see in this project is an example of the FileSystem polyfill and the
IndexedDB polyfill working together to allow upload of photos to a local filesystem
from a (mobile) Safari browser. This example should work in most browsers.