Enhancing Firefox's Find-in-Page for Keyboard Navigation
by h43z (hompage)
We choose to use Firefox, not because it's easy but because it's hard. 
~ jfk probably

If you want to find searchterms and 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 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.

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?! 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 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. All done whenever you hit the enter key. 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!