开发者

SQLite Storage in Firefox 3.0 +

开发者 https://www.devze.com 2023-04-10 14:10 出处:网络
I have a Firefox extension that supp开发者_JAVA百科orts Firefox 3+, and SQLite database is important for my extension. I saw on the MDN that the API might change and it`s \"unfrozen\", should I be wor

I have a Firefox extension that supp开发者_JAVA百科orts Firefox 3+, and SQLite database is important for my extension. I saw on the MDN that the API might change and it`s "unfrozen", should I be worried about it?

The API is currently "unfrozen", which means it is subject to change at any time; in fact, it has changed somewhat with each release of Firefox since it was introduced, and will likely continue to do so for a while.


This warning is probably outdated, it has been added to the original version of the document years ago and hasn't been updated since. Fact is, starting with Firefox 4 all APIs are unfrozen and could change. But that shouldn't really be a reason to worry. As SQLite access goes, the API seems pretty mature by now and Mozilla developers are mostly tweaking performance without introducing breaking changes. The most important change was the introduction of asynchronous API in Firefox 3.5 and the deprecation of the synchronous API. But as long as you only use asynchronous API you should be on the safe side (I cannot imagine that you really need to support the ancient Firefox 3.0 release, I guess that you actually meant Firefox 3.6).


For something so widely used I doubt it but it's easy enough to write code to work around that and keep your addon backwards compatible (at least in javascript). What I ended up doing is abstracting away methods that did change and wrapping them in my own calls that would do something like

if (methodInFF3) doFF3Method();
else doNewMethod();

or something like that. This way when things changed I only had to change the code in one place instead of many but then again the first time it happened I had to change the code everywhere. For SQLite I probably wouldn't worry too much though but that's just me, just make sure that when a new release comes out you check the docs to see if anything has been changed and you should be fine.

0

精彩评论

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