2012-05-22 27 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也是如此。