ebidel / idb.filesystem.js

HTML5 Filesystem API polyfill using IndexedDB
https://www.npmjs.com/package/idb.filesystem.js
Other
487 stars 46 forks source link

Add optimistic storage implemented in FF26 #29

Open jameslafa opened 10 years ago

jameslafa commented 10 years ago

Firefox 26 is out today and added a new interesting feature :

IndexedDB can now be used as a "optimistic" storage area so it doesn't require any prompts and data is stored in a pool with LRU eviction policy, in short temporary storage Bugzilla details

To use this new feature, we need to give an configuration object as argument instead of a version 1 when we execute indexedDB.open.

Because the syntax of the function has change from numeric to object, the new version is not compatible with the old one. In consequence, on a version prior to FF26, an TypeError exception will be thrown and then we can fallback to the previous way of opening indexedDB.

Every tests pass on FF25 and FF26.