A Small Change To Improve Browsers for Keyboard Navigation
by h43z (hompage)
We choose to use Firefox, not because it's easy but because it's hard.
~ jfk probably

(This problem applies to Chrome too though)

If you want to navigate websites with the keyboard you can make use of the ' search feature (aka "quick find for links") in Firefox. Just press ' and start typing. Any link with the anchor text you type will get highlighted. Once you press enter, firefox will navigate to the link under the highlighted anchor text.

Too bad most websites nowadays don't use links for navigation and actions. They have buttons and divs and once you click them stuff happens. 

And here lies the limitation with the other two build-in find features. Though the / (quick find) and the ctrl+f (find in page) search will highlight any text (not just links), nothing will happen if you press enter on that highlighted text
(once you dismissed the search dialog with escape).

Test it for yourself. Hello this is a link to my homepage and this a link with javascript:alert(1)
here a button with an handler.
and here a span with an onclick handler
Wouldn't it be great if firefox would just, like you know, click on the highlighted text (browser created a selection) whenever I press enter?! YES IT WOULD and that's why I created this little extension. All it does is inject these lines. addEventListener('keydown', event => { if(event.key !== 'Enter') return // more cases that should not hook enter are to be discovered... if(event.shiftKey) return const elementWithSelection = getSelection()?.anchorNode?.parentElement if(!elementWithSelection) return elementWithSelection.click() getSelection()?.removeAllRanges() }) The code just gets the node that has the current selection. Then looks for the parent html element of that node and clicks it. Afterwards removes the selection. This tiny hack makes keyboard navigation just so much better ~ h43z

Oh and let's not forget to MAKE FIREFOX STOP BURNING THROUGH YOUR BATTERY AND CPU!