12

This has become more of an issue since I got a Magic Mouse and have middle-click mapped as 3-finger touch. It's always annoyed me that Firefox even does this--is there a way to prevent firefox from closing tabs when you middle-click them?

0

4 Answers 4

6

As there doesn't appear to be a setting in about:config, the only way i know how to do it is using the addon Tab Mix Plus: https://addons.mozilla.org/en-US/firefox/addon/1122

2
  • that looks to be uber-overkill for the one thing I want to do, but thanks for the suggestion.
    – Brade
    Feb 26, 2010 at 19:56
  • 4
    Tab Mix Plus appears to have ceased development after Firefox Quantum. Is there another solution now? Nov 27, 2018 at 11:45
2
+50

There is a long-running bug report Bug 1439247 : "close tab with middle click" feature is disruptive on touchpads where middle click is triggered unintentionally where Firefox devs seem unable to understand the importance of the problem. Although apparently the code to introduce such an option was coded and ready, it was never released.

This answer uses the free AutoHotkey V1 on Windows. For Linux or MacOS see the post AutoHotkey equivalent.

The following example script will disable middle-click in Firefox.
I have not been able to limit it to the tabs area.

#IfWinActive ahk_exe firefox.exe
MButton::

After installing AutoHotKey, put the above text in a .ahk file and double-click it to test. You may stop the script by right-click on the green H icon in the traybar and choosing Exit. To have it run on login, place it in the Startup group at
C:\Users\USER-NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup.

Useful AutoHotkey documentation:

1
  • If it's worth your while, do add your voice to bugzilla.mozilla.org/show_bug.cgi?id=1439247 (""close tab with middle click" feature is disruptive on touchpads where middle click is triggered unintentionally"). Developers appear to be reluctant. Jan 12 at 20:06
0

Though I've successfully used userChrome.css to prevent creating a new tab, this answer only partially answers your question for preventing tab closing, and needs improvement. If someone can fix the issue that this code prevents all mouse events on the tab bar, please edit or comment.

If userChrome.css file is not in the Firefox profile, create it using Npotepad or other text editor. For example, in Windows, it would be in C:\Users\<user>\AppData\Roaming\Mozilla\firefox\Profiles\<profile>.default\chrome.

Edit userChrome.css to add the following lines (N.B. TabsToolbar seems to be case-sensitive).

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */

/* Disable All Tab Mouse Events */
#tabbrowser-tabs .arrowscrollbox-scrollbox{pointer-events: none} .tabbrowser-tab,.tabs-newtab-button{pointer-events: none}
#TabsToolbar .toolbar-items {pointer-events: none}
-1

It is a system setting not Firefox. You can check on the file explorer.

On Ubuntu 18 gnome : gnome-tweaks > Windows > Titlebar Actions > Middle-Click > select Toggle Maximize

On other system : gsettings command line here: https://askubuntu.com/a/655648/360110

1
  • I believe the question is about browser tabs, not Gnome windows.
    – hackerb9
    Jun 30, 2019 at 4:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .