IndexedDB support and polyfills
Before we go further, it's important to discuss the support situation for IndexedDB. As it is a more recent specification than Web SQL Database, it has much less support. On some platforms that support it, is can also be extremely limited and/or buggy.
Note
For up-to-date browser support, see http://caniuse.com/#feat=indexeddb.
As of this writing, IndexedDB had the following mobile browser support:
iOS: No support on iOS 7.x; extremely buggy behavior on iOS 8.x as well as iOS 9.x
Android: no support for versions less than 4.4; full support on Android 4.4 and higher
Desktop support fares quite a bit better; Chrome and Firefox has supported a full IndexedDB implementation for several versions now, while Safari on Oave has a buggy implementation (which should be no surprise, given that iOS also has a buggy implementation). On the desktop, Internet Explorer has had a partial implementation since version 10.
All of this means that if you're going to support different...