Fixing Firefox's context menu
17 October 2018Even though Slackware uses the ESR releases of Firefox, every time I upgrade comes with the possibility of some nasty surprises. This includes a pathological desire to keep changing the interface — there is an extension called Classic Theme Restorer that leaves no doubt as to what it is used for, but it seems that Mozilla still don’t get the hint. As usual for a major release, they have broken almost everything in sight, but there was one that took a lot longer than usual to sort out.
The problem
The latest annoyance is with the right-clicking pop-up menu: To avoid an immediate selection of one of the items — usually either going back one page or opening a link in a new window — you have to keep the button pressed and move the cursor a bit to the right. This is very annoying for people like me who often right-click and don't hold the button down before selecting a menu item.The fix
The big break in working this out was a Reddit post. Within the Firefox profile directory — under Linux this is typically~/.mozilla/firefox/${PROFILE}
where ${PROFILE}
is random characters) — add the following to /chrome/userChrome.css
, creating it is it does not already exist:
#context-back, #context-openlinkintab, #context-openlink, #context-openlinkprivate { margin-left: 6px; }
These CSS changes shift the items near the top of the pop-up menu slightly to the right, so that the activation area — blue in the screenshot below — is away from the edge:
This is not the only way to fix the problem via CSS, but this one suits me fine — I did not want to dive deeply into how Firefox structures all its styling.