New experimental IndexedDB backend for storage.local API (bug 1406181)

Luca Greco lgreco at mozilla.com
Thu Jun 7 20:51:49 UTC 2018


As many may have already noticed, we recently landed a new experimental
backend for the storage.local WebExtensions API (bug 1406181
<https://bugzilla.mozilla.org/show_bug.cgi?id=1406181>). Here is some
additional detail related to the the “reason behind the new backend” and
“how to try it”.

== Why a new backend? What advantages should be provided by it?

The new backend uses IndexedDB instead of a JSONFile, which should allow
the storage.local API to store more data than the maximum amount that an
extension can currently store in the current JSONFile backend. But more
importantly, it should have a smaller performance impact than the JSONFile
backend (which always reads and writes the data from the main process and
often introduces a latency in the main thread, with a resulting lag in the
UI responsiveness).

== Can I use the new backend?

The new backend is currently behind a preference and disabled by default,
while QA is looking at it.

You can also test the new backend by setting the
"extensions.webextensions.ExtensionStorageIDB.enabled" preference to true
from about:config (or from the command line using "web-ext run"), but we
strongly advise to do NOT enable it in your real Firefox profiles yet,
because:

When Firefox is started with the above preference enabled, the existing
storage.local data will be migrated from the JSONFile into an IndexedDB
database; the old storage file will be removed when the data migration is
completed successfully and there is no automated (and/or easy) way to
migrate the data back to the old JSONFile.

Aside from that, any input on the performance and behaviors of the new
backend are very welcome, but please use a separate profile (a new pristine
one or a new one cloned from one of your existing real Firefox profiles) to
prevent involuntary/unexpected extension data loss.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/dev-addons/attachments/20180607/7cb79599/attachment.html>


More information about the Dev-addons mailing list