0

我正在尝试从窗口对象访问 indexedDB,但是我不断收到以下错误。

DOMException: Failed to execute 'open' on 'IDBFactory': access to the Indexed Database API is denied in this context.

这就是我试图做到的方式。

await page.evaluate(() => {
    const idb = window.indexedDB.open("databaseName");
});

我还设置--allow-file-access-from-files为 args 中的一部分jest-puppeteer.config.js并设置browserContext: 'default'

我仍然无法让它工作!有没有人有同样的问题?

4

0 回答 0