[Back to top]

A brief analysis of JSON file-backed storage

Several components in Firefox — including libpref, XULStore, autofill, and logins — follow a general pattern:

JSONFile.jsm is a centralized implementation of this pattern. It supports Promise-based asynchronous loading, synchronous loading, and flushes asynchronously, defaulting to 1500ms after each change. libpref flushes after 500msec.

This approach is well suited to data that:

Advantages of this approach:


[Back to top]