WebExtensions first impressions

I’m a developer on the Hypothesis web annotation project and I wanted to share some first impressions of using the new WebExtensions APIs for building Firefox extensions and in particular porting our existing Chrome extension.

  • A Firefox extension is one of our most requested features. With an hour’s work and a couple of minor tweaks I was able to create a working add-on for Firefox using WebExtensions based on our code for Chrome. This is fantastic, thank-you. Our users will be very happy.
  • The documentation on MDN was easy to follow but for existing Firefox developers, it doesn’t really explain the benefits of WebExtensions beyond Chrome consistency (which is important). Based on my experience watching a team of develpers trying to build extensions for Firefox, Chrome and Safari with the previous APIs, they found it much easier to work with Chrome and Safari because the background pages are written in a DOM-like environment and they can re-use their existing knowledge of APIs, security etc. This is worth emphasizing.
  • The UI for addons is visually more attractive in Firefox - from subtly better rendering of the toolbar icons through to a cleaner about:addons page.
  • As a small team which releases new versions of our software multiple times a week, automating the deployment process is really important. Therefore, I’m very grateful for the recent changes to the signing policy and the availability of APIs for publishing extensions.
  • Related to deployment, having the install and upgrade process for extensions be really smooth and reliable will also make our lives much easier.

Some thoughts going forwards:

  • Having WebExtensions in Firefox for Android and iOS would be very helpful at expanding our reach, since we have a large number of potential users who do most of their reading on phones and tablets.
  • Currently there is no permissions UI. That’s an important part of the UX which we’d like to give feedback on, so I wondered what the status is?

I also ran into a handful of bugs, none critical:

  • If the browser is on a chrome page (such as about:addons) when you try to install a .xpi via File -> Open, the installation fails with a “Firefox prevented this site from asking you to install software on your computer” error
  • chrome.tabs.executeScript does not invoke its callback known bug
  • <script> tags injected into the page by a content script are not executed in Firefox. They are in Chrome.
  • On a separate non-WebExtensions project, I experienced issues with jpm sign timing out during the validation process. The tool times out after 60 seconds but validation takes longer than that about half the time. I could submit a PR for jpm to simply change the timeout or make it configurable, but really the process needs to be made faster.

On the whole, I think WebExtensions will be a great step forwards for Firefox add-on ecosystem.

5 Likes

Thank you for the detailed feedback! This is extremely useful to us. I don’t have answers to your questions, but I shared this with others who might.

As for the bugs that you discovered and aren’t known yet, please file a bug for each with the details, and ideally a sample add-on that demonstrates the problem.

Thanks!

Thanks for feedback.

Improving the performance of AMO is being tracked here: https://github.com/mozilla/olympia/issues/1244

Bugs for permissions are here: http://arewewebextensionsyet.com/#permissions … patches welcome! :slight_smile:

Thanks @jorgev . Something that wasn’t completely clear to me reading https://blog.mozilla.org/addons/2015/12/21/webextensions-in-firefox-45-2/ is whether we will be able to ship WebExtensions to users of Firefox 45 on the stable channel in March, even though the APIs are in an “alpha” state, although it appears they are sufficient for us.

We’ll start supporting WebExtension uploads on AMO very soon, so you’ll be able to start distributing them to users, even if in an experimental state.

2 Likes

Just to let you know WebExtensions uploads now (mostly) work on AMO. We’ve found a few small bugs we are working on, but it should work.

Blog post coming soon.

To address your question, you should be able to ship a WebExtension add-on to users of Firefox 45 if you want.

1 Like

Great! Thanks for the update and confirmation @amckay