Firefox Extensions

Extensions in Firefox 60

Many people read this blog because they’ve written extensions for Firefox in the past. Others, though, know some HTML, CSS, and JavaScript and have been thinking about writing their first extension. Either way, now is the perfect time to jump into the WebExtensions ecosystem.

That’s because we’re having a contest! Develop an extension for Firefox and enter it into the Firefox Quantum Extensions Challenge by April 15, 2018. Your extension could win you a brand-new Apple iPad Pro or a $250 gift card to Amazon.

And if you want to make your extension even better, consider using some of the new WebExtensions API discussed below. These new and improved API are available in Firefox 60, recently released to the Beta Channel.

A Profusion of Theme Properties

Since “Best Dynamic Theme” is one of the award categories for the Firefox Quantum Extension Challenge, let’s start with improvements to Themes. Release 60 adds a pile of new items to the list of elements that can be themed, doubling the number of individual components.  These include:

  • tab_line – Line color of the selected tab.
  • tab_selected – Background color of the selected tab.
  • popup – The background color of popups (such as the arrow panels).
  • popup_border – The border color of popups.
  • popup_text – The text color of popups.
  • tab_loading – The color of the tab loading indicator and the tab loading burst.
  • icons – The color of toolbar icons.
  • icons_attention – The color of toolbar icons in attention state such as the starred bookmark icon or finished download icon.
  • frame_inactive – The same as “accentcolor”, but only applied to inactive windows, provided for Chrome compatibility.
  • button_background_active – The color of the background of pressed toolbar buttons.
  • button_background_hover – The color of the background of toolbar buttons on hover.
  • toolbar_field_separator – The color of separators inside the URL bar (also available in Firefox 59; note that in Firefox 58 it was implemented under toolbar_vertical_separator)
  • toolbar_vertical_separator – The color of the separator next to the application menu icon (also available in Firefox 59; note that in Firefox 58 it corresponds to the color of separators inside the URL bar).

Also new for Firefox 60, the headerURL property is no longer mandatory, removing a somewhat arbitrary condition that made themes a bit clunky in the past.

Remember, the contest awards a prize for the best Dynamic Theme, so use the theme API to control and change the various UI elements in creative ways. Want an awesome tutorial that talks about Dynamic Themes? Check out the video below.

More Tab Features

Consistent with each release since Quantum 57, tabs remain a focus of WebExtension growth and improvement. Several bigger features will land in release 61 (expert Bugzilla miners are likely aware of them already), but Firefox 60 still offers a number of important items:

Improving Debugging and Development

Several new additions landed that make the debugging and development of extensions easier, including:

Proxy Improvements

The proxy API is quickly maturing, and Firefox 60 adds more functionality by adding the asynchronous proxy.onRequest API.  This API is ideal for extensions looking to deal with proxy requests in a background script.  Details are still being documented on MDN at the time of this writing but should be available soon.

Network Extensions Get DNS

Extensions now have access to Firefox’s DNS service to resolve hostnames. The new browser.dns() API takes a hostname string (with optional parameters) and resolves it to a DNS record for that hostname. To use this new API, your extension must declare the “dns” permission.

Dynamic Keyboard Shortcuts

Two new API were added to the Commands namespace that allow extensions to change their keyboard shortcuts at runtime. The first, commands.update, allows an extension to change the shortcut key and/or description associated with a command, while the second, commands.reset, reverts a command back to the keyboard shortcut and description originally specified in the manifest file.

Keeping Users Informed

In keeping with our mission to ensure that users are always informed and in control of what extensions are doing, a few new messages have been added to the browser interface:

Enhancing All the Action

The browserAction, pageAction, and sidebarAction are three of the most commonly used WebExtension features, and all three get some improvement in Firefox 60:

Other Improvements

The items mentioned above highlight some of the bigger and/or more visible changes that appear in Firefox 60. As always, though, many other minor or less visible improvements to WebExtensions also landed, including:

Thank You

A total of 63 features or improvements were landed for WebExtensions as part of Firefox 60 Beta. Thank you to our many contributors for this release, especially our community volunteers including: Tim Nguyen, Oriol Brufau, Richard Marti, Prathiksha Guruprasad, Vinicius Costa e Silva, Vivek Dhingra, Zhengyi Lian, Connor Masini, DW-dev, Bogdan Podzerca, and Dylan Stokes. As always, we sincerely appreciate you helping ensure that individuals have the ability to shape the Internet and their own experiences on it. If you are interested in contributing to the WebExtensions ecosystem, please take a look at our wiki.

This post is going up a bit later than normal and there are already several additions and changes to the WebExtensions API in progress for Firefox 61, so continue watching this space for more information. In the meantime, please continue to send us your feedback.

An earlier version of this article incorrectly stated that the theme properties popup_highlight and popup_highlight_text were available in Firefox 60, and that popup and popup_text could be used to style the URL and search bar autocomplete panels. All four of those things will actually appear in Firefox 61 (which is available in the Firefox Nightly channel right now).

8 comments on “Extensions in Firefox 60”

  1. Robert Ab wrote on

    Is any chance that work on Bug 1413525 will start soon? It would be really great if you could assign engineer to work on this bug.
    This single bug (Bug 1413525) (as well as Bug 1378647) are very important for session managers (Session Manager, Tab Mix Plus, Tab Session Manager, MySessions, and maybe Session Buddy in the future) and its users (approx. 1 mln).
    Also other bugs probably will be not needed if Bug 1413525 (and maybe Bug 1378647) will be solved.

    As you can see >300 users has already voted on Bug 1413525 and on four other session manager-related bugs, including Bug 1378647 and Bug 1427928 (meta-bug).

    1. Robert Ab wrote on

  2. BryM wrote on

    A contest. OH. BOY.
    Let’s have a BETTER contest – one that, say, brings Firefox back to being a decent browser! Each and every update over the last few years makes it more infuriating to use: disabled add-ons; sketchy default settings {ie TELEMETRY}, and the worst one yet – “How does Firefox make you feel?” followed by “happy” or “sad” with a little happy or sad face … is this a web browser or a first grade classroom? Trying to imitate Google and Facebook’s approach to its users is NOT [read: !!NOT!!] the way Mozilla should be going.

  3. Tommy D. wrote on

    Wait, we’re having a contest for a browser version that is not even out, yet? This should be renamed the Beta Contest or something.

  4. Stefan wrote on

    Won’t go above Firefox 52.6.0 ESR due to many of my very needed addons won’t work in the new Firefox. Update after update have disabled addon after addon…. Thumbs down for Quantum ! Time for Mozilla to go back a few years and drop the Quantum cr*p !

  5. Langenscheiss wrote on

    “Opening a popup now gets focus (this author’s personal note: YES!)”

    Yeah, finally, but, to be honest…

    …THIS should have been fixed a longer time ago. Something like this is a BASIC FUNCTIONALITY, and the bug has been known for a long time. I think they should have given it a higher priority. It seems to me like the fix could have made it, with some more resources shifted towards it, to 58 or 59 already.

  6. Ett Chung wrote on

    About “Dynamic Keyboard Shortcuts”:
    Why we let add-on developers create their own shortcuts setting page, rather than provide an integrated
    management interface (like Google Chrome did)?

    User can’t change shortcuts if add-on developer don’t provide shortcuts setting page. This means that the right to modify shortcuts is owned by the developer rather than the user.

    The integrated management interface has more benefits:
    1. Add-on developer don’t need implement their own shortcuts setting page, they have less coding effort. If developer porting extension from Chrome to Firefox, they don’t need modify code for shortcuts binding.
    2. User can manage all keyboard shortcuts of add-on, they don’t need check shortcuts conflict between add-ons.
    3. The interface experience are more consistent in keyboard shortcuts setting page.

  7. Pong wrote on

    Release after release FF is drfting away from what is suppose the most important function of it, web browsing.
    Introducing all kind of fancy stuff is nice (for a moment) for the spotlights but developing and adding one of the most wanted features; AUTO CLOSE BOOKMARK FOLDERS is denied for 5+ years.

    The one add-on which helps hundreds of thousands of users is unavailable from v57 and higher because of this crazy policy regarding old add-ons.

    Shame on you