In our last post for Firefox 68, we’ve introduced a great number of new features. In contrast, Firefox 69 only has a few new additions. Still, we are proud to present this round of changes to extensions in Firefox.
Better Topsites
The topSites API has received a few additions to better allow developers to retrieve the top sites as Firefox knows them. There are no changes to the defaults, but we’ve added a few options for better querying. The browser.topSites.get()
function has two additional options that can be specified to control what sites are returned:
includePinned
can be set to true to include sites that the user has pinned on the Firefox new tab.includeSearchShortcuts
can be set to true for including search shortcuts
Passing both options allows to mimic the behavior you will see on the new tab page, where both pinned results and search shortcuts are available.
User Scripts
This is technically an addition to Firefox 68, but since we didn’t mention it in the last blog post it gets an honorable mention here. In March, we announced that user scripts were coming, and now they are here. Starting with Firefox 68, you will be able to use the userScripts API without needing to set any preferences in about:config.
The great advantage of the userScripts API is that it can run scripts with reduced privileges. Your extension can provide a mechanism to run user-provided scripts with a custom API, avoiding the need to use eval in content scripts. This makes it easier to adhere to the security and privacy standards of our add-on policies. Please see the original post on this feature for an example on how to use the API while we update the documentation.
Miscellaneous
- The downloads API now correctly supports
byExtensionId
andbyExtensionName
for extension initiated downloads. - Clearing site permissions no longer re-prompts the user to accept storage permissions after a restart.
- Using
alert()
in a background page will no longer block the extension from running. - The proxy.onRequest API now also supports FTP and WebSocket requests.
A round of applause goes to our volunteer contributors Martin Matous, Michael Krasnov, Myeongjun Go, Joe Jalbert, as well as everyone else who has made these additions in Firefox 69 possible.
Hans the Hans
wrote on