I can’t manage to save data using indexedDB in a Firefox extension. I also cannot find any information about indexedDB and Firefox extensions.
Has anyone ever dealt with this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The only problem is, for
indexedDByou need a window, other than that there is not much special when using it from an add-on. Classic add-ons usually have a window that they can use, add-ons created with the Add-on SDK execute in a window-less context however. So if you are using the SDK you use the internalwindow-utilspackage:Note that all extensions use the same namespace (
chrome://) as far as IndexedDB goes. So you should choose the database name in such a way that it doesn’t collide with the names other extensions might choose.Starting with Firefox 12 the requirement to have a window is dropped.
nsIIndexedDatabaseManager.initWindowless()can be used to injectmozIndexedDBproperty into any object. Relevant bug: bug 587797.