Problem when loading into Firefox Add-on

Apr 13, 2011 at 10:29 PM

I'm trying to use the library in an Firefox 4 Add-on but I'm getting the next error:

Error: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMStorageWindow.localStorage]
Source file: chrome://addon/content/datajs-0.0.3.min.js
Line: 14

Apr 14, 2011 at 1:04 AM

Hi Bitisuvanje,

This seems to be a Firefox issue in which access to the localStorage component is denied in the context of an add on.  On the other hand, it is interesting that you are trying to use the library in this way and it is a scenario we hadn't considered before.  Could you please share a minimum repro with us?

Regards,

Alex Trigo.

Apr 14, 2011 at 7:40 AM

Thanks for the fast response.

I want to use the library for communication with my WCF Data Service. The add-on sends junks of data to the service, and vice versa.

Salute,
Adam Markovski

Apr 14, 2011 at 8:38 AM

Instead of localStorage, I've used globalStorage...

The next error was, unknown one, at line 4531: var mozIndexedDB = window.mozIndexedDB;

So to fix this I've referred to this post. And instead of mozIndexedDB, I've used mozIndexedDb.

Now it's loaded.

Adam

Apr 14, 2011 at 6:18 PM

Hi Adam,

It is great to see that you were able to fix your problem.  Are you using FireFox 4 beta?  If yes, which number of beta?  It strikes to my attention the difference in the mozIndexedDB name...

Regards,

Alex Trigo.

Apr 15, 2011 at 6:57 PM

The strange thing is that I run Firefox 4.0. :)

Adam

Apr 15, 2011 at 8:00 PM

Hi Adam,

Seems to me, based on the post you mention, that you might be using FireFox 4.0 beta 10 and that's the reason of the object name change.  We started development of datajs.0.0.3 on FireFox 4.0 beta 11 and up.. which use the mozIndexedDB identifier instead.

Regards,

Alex Trigo.