大大们好
小弟想请问关于关闭indexedDB的问题~~
delete(callback) {
const DBDeleteRequest = indexedDB.deleteDatabase(dbName);
DBDeleteRequest.onsuccess = (event) => {
return callback(false, event);
};
DBDeleteRequest.onblocked = (event) => {
// 目前必block
// 只会执行这里
};
DBDeleteRequest.onerror = (err) => {
return callback(err, null);
};
}
我尝试再开一个indexedDB.open然后再db.close(),
再关闭一次,结果还是被blocked...
现在变成要试5~10次后location.reload()才能确定db被关闭...
请问有没有正解??