WebExtensions in Firefox 47

We last updated you on our progress with WebExtensions when Firefox 46 landed in Developer Edition (Aurora), and today we have an update for Firefox 47, which landed in Developer Edition last week.

While WebExtensions will remain in a beta state in Firefox 47, we’ve made lots of progress, with 81 bugs closed since the last update. As of this update, we are still on track for a milestone release in Firefox 48 when it hits Developer Edition.

There’s a new way for you to get involved! Tell us which APIs you’d like support for by filling out this survey, to help us better prioritize them. We have also created a wiki page filled with resources to support developers through all the changes coming in the add-ons world.

APIs Implemented

Adding keyboard shortcuts that trigger actions in your extension arrived with the partial implementation of commands. This allows developers to map key presses from the manifest to actions in your add-on.

With the partial implementation of downloads you can download files from your add-on and get updates of the download progress. You can also search through the existing downloads using the search API.

Several additions and changes in webRequest have been included in Firefox 47. These prelude even bigger news for add-ons that focus on security and privacy to work perform the sort of network inspection needed to do their job. More details on these changes are covered in Giorgio’s blog post.

Also completed is the i18n API and we are getting closer to completing the bookmarks API.

More of the tabs API have been completed, including:

Several improvements have been made to the windows API, including :

  • Added support for creating a new window from an existing tab, popup-type windows
  • Querying and changing a windows’ minimized, maximized and fullscreen state.

All asynchronous methods which accept a callback function will now return a Promise if no callback is passed. These promises resolve at the same time a callback would normally be called, and reject with the value of lastError in cases where that would otherwise be set. Additionally, onMessage listeners may now return a Promise object if they wish to send a reply. When the promise resolves, its resolution value will be returned to the sender.

WebExtension manifests now support a “creator” property, which is displayed in the Add-on Manager, to indicate the author of the add-on. Additionally, manifests are now fully type-checked at startup, and any type errors or unexpected properties are reported to the Browser Console for inspection.

For the full list of API changes, please see the bug list.

Command line tool

A new command line tool is being build for WebExtensions, called “web-ext” will allow you to run, test and sign add-ons easily from the command line. For example to run your add-on in a new profile, from your add-on, just call: web-ext run.

This command line utility is in its early days, but you can follow along with web-ext development on github.

New examples

We’ve been preparing examples of our APIs on github. In the last few weeks we’ve added two more examples:

  • bookmark-it: an add-on that toggles a bookmark for the currently active tab.
  • tabs-tabs-tabs: an add-on that demonstrates some of the tabs APIs available (currently move, duplicate, reload and remove)

There are currently ten example add-ons available in the repository. All of them can be installed easily by cloning the repository locally and then installing temporarily through about:debugging.
Over the coming months we will work our way towards a beta in Firefox 47 and the first stable release in Firefox 48. If you’d like to jump in to help, or get your API added, please join us on our mailing list or at one of our public meetings. You can also check out this wiki to see more ways to participate in the evolution of WebExtensions.

4 responses

  1. alex wrote on :

    nice progress , the webextension api looks really fleshed out , much better than the highlevel sdk

    and taking the survey i think you guys are on the right track with re-implementing lowlevel apis.

    if you are already reimplenting this whole new sdk it would supercool to have a lowlevel module which makes loading browser overlays and overlay windows easy and convenient .

    all old addons could be ported easily and a whole new breed of good looking and nicely performing addons with native ui could be born . much better then the crappy panels imho (i guess every longtime firfox user feels this way).
    panels are good for some things but when it gets more complicated like in umatrix it slows down the browser and it will autohide, lag and other crappyness…

  2. kajal sharma wrote on :

    nice i like mozilla , i love to use mozilla firefox

  3. Oleksandr wrote on :

    you can add chrome.sockets in the work plan for the WebExtensions?

    1. Andy McKay wrote on :

      Please see this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1247628