Fix for lighthouse ticket 115: certain versions of Android 2.2 return "null" for window.openDatabase. Hook in PhoneGap fallback for storage in this case.

This commit is contained in:
Fil Maj 2011-03-23 11:07:45 -07:00
parent 935295c9b8
commit b3e9794189

View File

@ -382,7 +382,7 @@ var CupcakeLocalStorage = function() {
}
};
PhoneGap.addConstructor(function() {
if (typeof window.openDatabase === "undefined") {
if (typeof window.openDatabase === "undefined" || window.openDatabase("test", "1.0", "TestDB", 1000) == null) {
navigator.openDatabase = window.openDatabase = DroidDB_openDatabase;
window.droiddb = new DroidDB();
}