Repository: Modernizr/Modernizr (js)

Issue:
add support for indexeddb 2.0
https://caniuse.com/#search=indexeddb

Now the indexeddb detect script only detects basic indexeddb apis.

But some browser versions implement 1.0 and some 2.0. 

So we can add a new script to detect 2.0 support.

In my opinion, 2.0 add some new apis compared to 1.0. Such as `getAll/getAllKeys`.

So we can use `'getAll' in IDBIndex.prototype` to determine whether the browser supports it.


Pull request description:
Add feature detection for IndexedDB 2.0
Closes #2571.

Patch:
diff --git a/feature-detects/storage/indexeddb2.js b/feature-detects/storage/indexeddb2.js
new file mode 100644
index 00000000..2d467255
--- /dev/null
+++ b/feature-detects/storage/indexeddb2.js
@@ -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);
+    });
+  });
+});
diff --git a/lib/config-all.json b/lib/config-all.json
index 5dc9ae5d..cd95b302 100644
--- a/lib/config-all.json
+++ b/lib/config-all.json
@@ -272,6 +272,7 @@
     "serviceworker",
     "speech/speech-recognition",
     "speech/speech-synthesis",
+    "storage/indexeddb2",
     "storage/localstorage",
     "storage/sessionstorage",
     "storage/websqldatabase",


Test patch:
diff --git a/test/browser/integration/caniuse.js b/test/browser/integration/caniuse.js
index 57ce81b4..bdeca55f 100644
--- a/test/browser/integration/caniuse.js
+++ b/test/browser/integration/caniuse.js
@@ -96,6 +96,7 @@ window.caniusecb = function(caniuse) {
       hsla: 'css3-colors',
       htmlimports: 'imports',
       indexeddb: 'indexeddb',
+      indexeddb2: 'indexeddb2',
       inlinesvg: 'svg-html5',
       inputtypes: 'forms',
       intersectionobserver: 'intersectionobserver',