在Webview 66.0.3359.126中,IndexedDB写入数据库失败

时间:2018-04-30 23:18:08

标签: android webview indexeddb

我的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版本:|

1 个答案:

答案 0 :(得分:0)