gpt4 book ai didi

javascript - Firefox 上 Web Worker 中的 IndexedDB

转载 作者:行者123 更新时间:2023-11-29 15:00:35 24 4
gpt4 key购买 nike

我正在尝试在 web worker 中使用 Firefox 12 中的 indexedDB。

dbRequest = mozIndexedDB.open("mydb","test db");

但是 Firefox 显示错误:mozIndexedDB 未定义

尝试了一些其他方法,例如 self.mozIndexedDBmoz_indexedDBSync 但无济于事。
它在使用 webkitIndexedDB 的 Chrome 中运行良好。

任何帮助将不胜感激......

最佳答案

几个月前我遇到了类似的事情。 Firefox 尚不支持此功能:

IndexedDB includes both a synchronous and an asynchronous API. The synchronous API is intended for use with WebWorkers (However, IndexedDB is still not supported in Web Workers as of Dec 2011); while the asynchronous API is intended for normal web use. In the majority of cases where you use IndexedDB, you will use the asynchronous API, therefore this article discusses how you can use the asynchronous API.

来自 https://developer.mozilla.org/en/IndexedDB/Using_IndexedDB

关于javascript - Firefox 上 Web Worker 中的 IndexedDB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10698728/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com