2012-05-22 57 views
3

我想在Firefox 12中使用indexedDB中的web workerFirefox中的Web Worker中的IndexedDB

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

但是火狐显示了一个错误:mozIndexedDB未定义

尝试一些其他的如self.mozIndexedDBmoz_indexedDBSync但无济于事。
它在Chrome中使用webkitIndexedDB效果很好。

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

+0

约在问题提出后的1000天...我还需要这个功能,并发现firefox developer edition v37支持web工作人员的索引数据库,所以希望它会很快到达 – ajayel

+0

现在支持它:https:// bugzilla。 mozilla.org/show_bug.cgi?id=701634 –

回答

2

我遇到类似的几个月前。 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

+0

Thanx的快速回复。我感到困惑的事实,它在Chrome中的作品。在我看来,Firefox有更完整的IndexedDB规范实现,因此认为它应该可以在Firefox中工作......我想我们必须等待...... – BriscoCountyJr

+0

事实上,WebWorker访问将是“同步”API并且唯一支持的API是“异步”版本。 AFAIK没有承诺支持同步API的供应商。由于这些调用将被阻止,无论如何,基于IDB性能,我们迄今为止已经看到异步版本。 – buley

0

从IndexedDB的规范,同步API可以被删除

Features at risk

The following features are at risk and may be removed, due to potential lack of implementations.

3.3 Synchronous APIs 

另外请注意,您可以使用异步网络工作者的API也是如此。