indexedDB.open method not effect

227 views Asked by At

environment: use webview load remote url in ipad(iPad mini5, the version is 14.6), when the remote url loaded and execute then code is shown below, and nothing print. It seems that indexedDB.open() does not have any return.

After my testing, there will only be problems with version 14.6, and there will be no problem with versions below ios 14.4. I'm not sure if it's a webview problem or an indexedDB problem

  var dbName = "test";
  var dbVersion = 1;
  var indexedDB = window.indexedDB ||
                  window.webkitIndexedDB ||
                  window.mozIndexedDB;
  var db = '';

  console.log("setup indexed db");
  var request = indexedDB.open(dbName, dbVersion);
  request.onsuccess = function(e) {
    console.log("db request success");
  };

  request.onblocked = function(e) {
    console.log("DB open blocked", e);
  };

  request.onerror = function(err) {
    console.log("error", err);
  };

  request.onversionchange = function(err) {
    console.log("onversionchange", err);
  };

  request.onupgradeneeded = function(e) {
    console.log("upgrade needed");
  };
1

There are 1 answers

0
zhuang.liang On

After testing, it was found that there would be a problem with wkWebview and that using uiWebview would not. So I think there's a problem with the new version of ios wkWebview for indexedDB compatibility