开发者

Firefox extension development and sqlite

I am making a Firefox extension and looking for a way to store data

I see the sq开发者_如何学Golite database is available and wonder if it is possible for other extensions to do queries to my database?

From what I have found I can not see any way to do that.

Are there any other solution in Firefox to store private data.

Bob


Well, if other extensions know where you store the database file and what is the structure of the database, then they can easily make queries on that.

Afaik there is no real "secure" way. You can store data in preferences, but that is even easier to access.


You don't want to store too much data in preferences (they're read synchronously at startup!)

Just having knowledge of the sqlite filename won't work since you whoever opens the database first will lock it. The easiest way to let other extensions do queries on your database is to expose the DB connection somewhere. That somewhere could be an XPCOM service component (this is how various toolkit services such as history, bookmarks, form data etc. do it, FWIW) or simply an object you import from a JavaScript module if you only want to consider JavaScript consumers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜