Add verify for localForage

This commit is contained in:
oc 2018-09-04 22:20:40 +08:00
parent e9da2e6bd5
commit a675d78d9b

View File

@ -238,9 +238,13 @@ core.prototype.init = function (coreData, callback) {
try {
core.getLocalForage("__test__", null, function(data) {
if (data!="__test__") {
console.log("__test__ fail!");
console.log("localForage unsupported!");
core.platform.useLocalForage=false;
}
else {
console.log("localForage supported!")
core.removeLocalForage("__test__");
}
}, function(e) {console.log(e); core.platform.useLocalForage=false;})
}
catch (e) {console.log(e); core.platform.useLocalForage=false;}