pouchdb/pouchdb — pull request #2582 by nolanlawson (2014-08-09 16:13:36+00:00)
Title: (#2581) - fix websql size on Android <=4.3

This is the first time we've actually used browser-sniffing in PouchDB. I'm not happy about it, but I cannot think of any other way.

If we choose 0, Android <=4.3 barfs.
If we choose 1, Android <=4.3 barfs 2/3 of the way through.
If we choose 5000000, iOS shows the popup about 1/2 of the way through.

We could set it to some arbitrarily "good" value for our unit tests (e.g. 1000000), but this is arguably not the best thing for users.

Users want to not have to deal with this thing. If we set it to 5000000 for Android and 1 for iOS, then we're minimizing their risk of running into a DOM Exception 18 on Android while also minimizing the risk that they will see the popup on iOS. (I chose 1 instead of 0 because I don't know what other platforms might barf immediately if given the 0. At least with 1, they only barf after you stuff too much data in them.)

You can take my word for it that this commit passes on Android 4.1, 4.3, and 4.4+websql.