【问题标题】:"Failed to open indexedDB" error in Firefox when trying to get record from IndexedDB using PouchDB尝试使用 PouchDB 从 IndexedDB 获取记录时,Firefox 中出现“无法打开 indexedDB”错误
【发布时间】: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 的实现是否处理连接阻塞事件?

标签: indexeddb pouchdb


【解决方案1】:

设置浏览器的隐私和安全设置以记住历史记录

【讨论】:

    猜你喜欢
    • 2012-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-17
    • 1970-01-01
    • 2020-01-09
    • 1970-01-01
    相关资源
    最近更新 更多