Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable ctrl-b keyboard shortcut in Firefox?

As a tmux user, there is a lot of Ctrl+b going on. Also a lot of Firefox.

It's safe to say I never, ever want to see the book mark vertical bar. No interest. Never had any in 20 years of computer use.

Is there any way to disable Ctrl+b in Firefox without using a plug-in?

like image 455
datakid Avatar asked Aug 01 '16 22:08

datakid


2 Answers

I've been able to disable the Ctrl+B shortcut by using the Shortkeys extension.

Its configuration can be a little cumbersome, so here's a quick guide:

  • In the extensions page (about:addons), click the ... menu next to the Shortkeys entry, and select "Preferences"
  • Add a new shortcut:
    • In the "Shortcut" column, type "Ctrl+B".
    • In the "Label" column, enter something like "Disable bookmarks sidebar".
    • In the "Behavior" column, select the "Do nothing" entry
  • Don’t foget to click the Save shortcuts button at the bottom of the page!

Note: This only works in the context of a web page. The default Firefox action will still execute if you press Ctrl+B while the cursor is e.g. in the URL bar or the search bar. But for me it's a great improvement already!

like image 164
waldyrious Avatar answered Sep 23 '22 04:09

waldyrious


Since Firefox 72, this needs to be done with autoconfig.js. See Firefox documentation and example usage.

OLD WAY: This can be accomplished using userChrome.js

Use the following code:

var key = document.getElementById('viewBookmarksSidebarKb');
if (key) key.remove();

Credit - I found this thanks to this answer https://superuser.com/questions/1318336/how-to-disable-ctrlq-shortcut-in-firefox-on-linux/1348082#1348082

like image 37
AdamS Avatar answered Sep 19 '22 04:09

AdamS