Following the explosion of extension features in Firefox 63, Firefox 64 moved into Beta with a quieter set of capabilities spread across many different areas.
The most visible change to extensions comes on the user-facing side of Firefox where the add-ons management page (about:addons) received an upgrade.
Changes on this page include:
- Each extension is shown as a card that can be clicked.
- Each card shows the description for the extension along with buttons for Options, Disable and Remove.
- The search area at the top is cleaned up.
- The page links to the Firefox Preferences page (about:preferences) and that page links back to about:addons, making navigation between the two very easy. These links appear in the bottom left corner of each page.
These changes are part of an ongoing redesign of about:addons that will make managing extensions and themes within Firefox simpler and more intuitive. You can expect to see additional changes in 2019.
As part of our continuing effort to make sure users are aware of when an extension is controlling some aspect of Firefox, the Notification Permissions window now shows when an extension is controlling the browser’s ability to accept or reject web notification requests.
When an extension is installed, the notification popup is now persistently shown off of the main (hamburger) menu. This ensures that the notification is always acknowledged by the user and can’t be accidentally dismissed by switching tabs.
Finally, extensions can now be removed by right-clicking on an extension’s browser action icon and selecting “Remove Extension” from the resulting context menu.
Firefox 63 saw a large number of improvements for extension context menus and, as promised, there are even more improvements in Firefox 64.
The biggest change is a new API that can be called from the
contextmenu DOM event to set a custom context menu in extension pages. This API,
browser.menus.overrideContext(), allows extensions to hide all default Firefox menu items in favor of providing a custom context menu UI. This context menu can consist of multiple top-level menu items from the extension, and may optionally include tab or bookmark context menu items from other extensions.
To use the new API, you must declare the
menus and the brand new
menus.overrideContext permission. Additionally, to include context menus from other extensions in the tab or bookmarks contexts, you must also declare the
bookmarks permissions, respectively.
The API is still being documented on MDN at the time of this writing, but the API takes a
contextOptions object as a parameter, which includes the following values:
showDefaults: boolean that indicates whether to include default Firefox menu items in the context menu (defaults to false)
context: optional parameter that indicates the
ContextTypeto override to allow menu items from other extensions in this context menu. Currently, only
showDefaultscannot be used with this option.
bookmarkId: required when context is
tabId: required when context is
Other improvements to extension context menus include:
browser.menus.update()now allows extensions to update an icon without having to delete and recreate the menu item.
menus.update()now support a viewTypes property. This is a list of view types that specifies where the menu item will be shown and can include
sidebar. It defaults to any view, including those without a viewType.
menus.onClickedevents now include the viewType described above as part of their info object so extensions can determine the type of view where the menu was shown or clicked.
menus.onClickedevent also added a button property to indicate which mouse button initiated the click (left, middle, right).
Minor Improvements in Many Areas
In addition to the extension management in Firefox and the context menu work, many smaller improvements were made throughout the WebExtension API.
- A new, optional manifest property for page actions called ‘pinned’ has been added. It specifies whether or not the page action should appear in the location bar by default when the user installs the extension (default is true).
- Extensions can now access the attention property on tabs, and can set the highlighted property from browser.tabs.update().
- An option was added to tabs.highlight() to prevent it from populating the returned window. This can have important performance benefits.
- Content scripts can now read from a <canvas> that they have modified.
- Themes can now change the sidebar border color.
- On Android, fixed an issue where browser action popups opened from private browsing tabs now also open as private windows.
- Along similar lines,
windows.create()now open the about:privatebrowsing page instead of about:newtab.
- Keys on the number pad may now be used for extension keyboard shortcuts.
- Extensions can now create devtools panel sidebars and use the new setPage() API to embed an extension page inside the devtools inspector sidebar.
Misc / Bug Fixes
browser.search.search()API no longer requires user input in order to be called. This makes the API much more useful, especially in asynchronous event listeners. This feature was also uplifted to Firefox 63.
- Fixed the
identity.launchWebAuthFlow()API so that the redirect_uri parameter is no longer mandatory. This fixes some OAuth services that require the redirect_uri be configured on the service.
- Fixed an issue so that the location bar focus is now handled properly when extensions open new tabs.
- Alarms created with a time that occurs in the past now fire immediately, instead of being ignored.
port.onMessageis now properly fired in content scripts from non-tabs locations (sidebar, extension popup views)
- The filename from the download API is now properly decoded.
A total of 73 features and improvements landed as part of Firefox 64. Volunteer contributors were a huge part of this release and a tremendous thank you goes out to our community, including: Oriol Brufau, Tomislav Jovanovic, Shivam Singhal, Tim Nguyen, Arshad Kazmi, Divyansh Sharma, Tom Schuster, Tim B, Tushar Arora, Prathiksha Guruprasad. It is the combined efforts of Mozilla and our amazing community that make Firefox a truly unique product. If you are interested in contributing to the WebExtensions ecosystem, please take a look at our wiki.