Skip to content

Commit

Permalink
Add feature detection for IndexedDB 2.0 (Modernizr#2607)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xenonym authored Oct 28, 2020
1 parent 67eb032 commit dc2fd4e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
22 changes: 22 additions & 0 deletions feature-detects/storage/indexeddb2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*!
{
"name": "IndexedDB 2.0",
"property": "indexeddb2",
"tags": ["storage"],
"caniuse": "indexeddb2",
"authors": ["Tan Zhen Yong (@Xenonym)"],
"polyfills": ["indexeddb"],
"async": true
}
!*/
/* DOC
Detects support for the IndexedDB 2.0 client-side storage API.
*/
define(['Modernizr', 'addTest', 'test/indexeddb'], function(Modernizr, addTest) {
Modernizr.addAsyncTest(function() {
Modernizr.on('indexeddb', function(result) {
if (!result) return;
addTest('indexeddb2', 'getAll' in IDBIndex.prototype);
});
});
});
1 change: 1 addition & 0 deletions lib/config-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@
"serviceworker",
"speech/speech-recognition",
"speech/speech-synthesis",
"storage/indexeddb2",
"storage/localstorage",
"storage/sessionstorage",
"storage/websqldatabase",
Expand Down
1 change: 1 addition & 0 deletions test/browser/integration/caniuse.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ window.caniusecb = function(caniuse) {
hsla: 'css3-colors',
htmlimports: 'imports',
indexeddb: 'indexeddb',
indexeddb2: 'indexeddb2',
inlinesvg: 'svg-html5',
inputtypes: 'forms',
intersectionobserver: 'intersectionobserver',
Expand Down

0 comments on commit dc2fd4e

Please sign in to comment.