Firefox Extension Development - Data Storage - is Firefox Preferences a good place?

后端 未结 2 1941
余生分开走
余生分开走 2021-01-03 10:54

I have developed a Firefox add-on that needs to save some user-data in the local machine. Right now, I use the filesystem functionality that Firefox provides to create some

2条回答
  •  死守一世寂寞
    2021-01-03 11:08

    It is possible to locate the profile or extensions directory of firefox via code. You can even locate the directory of your own extension. Portability shouldn't be a problem using this approach.

    You can find instructions at the MDC (File I/O).

    I wouldn't advice saving data in the preferences. Anyway, instead of using bare file i/o you may look into sqlite-databases - ubiquity uses those as well.

    Cheers.

提交回复
热议问题