Firefox 66 is currently in beta and, for extension developers, the changes to the WebExtensions API center primarily around improving performance, stability, and the development experience. A total of 30 issues were resolved in Firefox 66, including contributions from several volunteer community members.
Major Performance Improvements for Storage
I want to start by highlighting an important change that has a major, positive impact for Firefox users. Starting in release 66, extensions use IndexedDB as the backend for local storage instead of a JSON file. This results in a significant performance improvement for many extensions, while simultaneously reducing the amount of memory that Firefox uses.
This change is completely transparent to extension developers – you do not need to do anything to take advantage of this improvement. When users upgrade to Firefox 66, the local storage JSON file is silently migrated to IndexedDB. All extensions using the storage.local() API immediately realize the benefits, especially if they store small changes to large structures, as is true for ad-blockers, the most common and popular type of extension used in Firefox.
The video below, using Adblock Plus as an example, shows the significant performance improvements that extension users could see.
The remaining bug fixes and feature enhancements won’t be as noticeable as the change to local storage, but they nevertheless raise the overall quality of the WebExtensions API and make the development experience better. Some of the highlights include:
- Another improvement was landed in Firefox so that it uses less memory when extensions load objects from storage into memory.
- The “Manage Extension Shortcuts” page now uses a default icon if no icon was included in the manifest file.
- Fixed a case where the window.close() API was not properly closing browser extension popups.
- Extension ports are no longer disconnected when switching tabs in Responsive Design Mode.
- By-passing tracking protection now works for domains listed as host permissions when those domains are used as iframes within an extension page.
- The permissions prompt no longer appears when newly added host permissions are a subset of host permissions that have already been granted.
- The webRequest API will now throw an error if you try to use it in blocking mode without declaring the webRequestBlocking permission
- Bookmarks context menu items, added in Firefox 59, now also appear in the bookmarks sidebar and library window.
- Manifest files with no specified default icon now throw an error.
- Firefox no longer emits a warning when the manifest property `background.persistent` is set to `true`.