Skip to content

Commit

Permalink
Add instructions for Firefox V3 workaround
Browse files Browse the repository at this point in the history
In its current state, and presumably since the [Manifest V3
migration](#186),
the extension doesn't work on Firefox. However, it can be made fully
functional with a small change

When loading the extension in Firefox, the following is reported

```
There was an error during the temporary add-on installation.

Error details

background.service_worker is currently disabled
```

Firefox doesn't currently support `background.service_worker` in
Manifest V3: https://bugzilla.mozilla.org/show_bug.cgi?id=1573659. This
property was added when migrating to V3:
#186

If you remove this section from the manifest, it will work on V3. The
only caveat is that the icon won't change when on a GOV.UK page

I also tried changing `service_worker` to `scripts` and using an array
per [this

suggestion](mozilla/web-ext#2532 (comment)),
which also makes the extension functional, but doesn't make the
icon-changing script work. I suspect the `icon.js` code would need
updating for cross-browser support. Other suggestions later in that
thread might be worth exploring, but it might make more sense to hold
off until Firefox adds proper support if the user base is low
  • Loading branch information
yndajas authored Oct 17, 2024
1 parent 8872fc5 commit 7a73d26
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ is open and are removed on exit. Permanently-active extensions can be only be
installed from packages signed by Mozilla.

1. [Download the source from GitHub](https://github.com/alphagov/govuk-browser-extension/archive/main.zip) and unzip.
2. Visit [about:debugging](about:debugging) in your browser.
2. Remove the `background` section from `src/manifest.json`. The service worker specified in this section changes the colour of the icon when on a GOV.UK page, but it relies on `background.service_worker`, which is [currently unsupported in Firefox with Manifest V3](https://bugzilla.mozilla.org/show_bug.cgi?id=1573659).
3. Visit [about:debugging](about:debugging) in your browser.
4. Click `Load Temporary Add-on` to pop up a file selection dialog.
5. Navigate to `src` in the extension directory, and select `manifest.json`.
6. Visit any page on [GOV.UK](https://www.gov.uk).
Expand Down

0 comments on commit 7a73d26

Please sign in to comment.