til / Focus links in Firefox on MacOS
I recently started using Firefox as my main development browser. While doing some minor updates to this site, I found that I couldn’t tab focus to the links. Tabbing still worked fine in Chrome, so it must be something specific to Firefox.
This happens because Firefox honors macOS’s system settings, and there are two ways that we can make it focus links while tabbing.
Using system preferences #
In System Preferences → Keyboard, in the Shortcuts pane, check the “Use keyboard navigation to move focus between controls” at the bottom of the pane.
Using Firefox’s configuration #
In Firefox, type about:config
in the URL bar to open Firefox’s configuration editor. Click accept to move on if you receive a warning.
- Search at the top for
accessibility.tabfocus
, and remove the value if it exists as a boolean (true/false
). - Add a new value with the same name,
accessibility.tabfocus
, and give it an integer value of 7.
The value 7 is important. To understand what it means, we can take a look at the possible values of accessibility.tabfocus
:
- 1 - Only focus text fields
- 2 - Focus all form elements, except text fields.
- 4 - Only focus links
- (other) - Combine the values and their functionality. In our case, we want them all so 1 + 2 + 4 = 7