我的indexedDB应用程序完全适用于以前版本的Webview(55.xx),但是在系统自动升级到最新版本的Webview(66.xx)后出现了问题。
我已经检查过每一种可能性,但它没有在put方法上得到任何错误,而是显示成功。
这是在Android webview(66.xx)中失败的代码:
var request = indexedDB.open("library");
request.onupgradeneeded = function() {
// The database did not previously exist, so create object stores and indexes.
var db = request.result;
var store = db.createObjectStore("books", {keyPath: "isbn"});
var titleIndex = store.createIndex("by_title", "title", {unique: true});
var authorIndex = store.createIndex("by_author", "author");
// Populate with initial data. ==> (Code is failing on this point without throwing any error)
store.put({title: "Quarry Memories", author: "Fred", isbn: 123456});
store.put({title: "Water Buffaloes", author: "Fred", isbn: 234567});
store.put({title: "Bedrock Nights", author: "Barney", isbn: 345678});
};
request.onsuccess = function() {
db = request.result;
};
我使用的是Android 5.0版本:|
答案 0 :(得分:0)