【发布时间】:2020-03-04 19:36:42
【问题描述】:
我构建了一个简单的系统,允许人们为网页添加注释。这适用于 Chrome(版本 72.0.3626.109),但在 Firefox(版本 65.0.1)中,它在开发者控制台中给我一个错误。
error: true
message: "unknown"
name: "indexed_db_went_bad"
reason: "Failed to open indexedDB, are you in private browsing mode?"
stack: ""
status: 500
<prototype>: {…}
在 Firefox 开发控制台中进行调试,尝试在此 javascript 函数中调用 get 时会引发错误:
function pouchDbGetNote() {
notesDb.get(notesData.noteDbEntryId)
.then(function (response) {
returnNoteData(response);
}).catch(function (err) {
console.log(err);
});
}
请注意,当页面加载时,就在调用pouchDbGetNote() 函数之前,我通过以下方式加载数据库:
// Create/get database
try {
notesDb = new PouchDB(notesData.db_name);
} catch (e) {
console.log(e);
}
pouchDbGetNote();
我在 google 中搜索并没有找到真正的解决方案,除了建议通过 Firefox 升级修复它并暗示这也曾影响 IE/Edge。
上面的调用是在 jQuery(document).ready(function () { 块中进行的。
【问题讨论】:
-
PouchDB 的实现是否处理连接阻塞事件?