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 forjpm
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.