Closed Bug 266985 Opened 20 years ago Closed 4 years ago

No way to do nothing on middle mouse click (middlemouse.openNewWindow ignored)

Categories

(Firefox :: Tabbed Browser, defect)

x86
All
defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 77
Tracking Status
firefox77 --- verified

People

(Reporter: csthomas, Assigned: sander.vandemoortel)

References

()

Details

(Whiteboard: [bugday-20151005])

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a5) Gecko/20041028
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a5) Gecko/20041028

A middle mouse click either opens a link in a new tab or a window (see LXR link
in URL).  There is no way to ignore a middle click.  Firefox doesn't respect
middlemouse.openNewWindow

Reproducible: Always
Steps to Reproduce:
Why would we want it to do nothing?
(In reply to comment #1)
> Why would we want it to do nothing?

Seamonkey can, and someone asked me how to disable all middle mouse behavior,
since they keep accidentally hitting things.
(In reply to comment #1)
> Why would we want it to do nothing?

You'd want it to do nothing if you had a 3M ergo mouse.  This mouse has no
scroller; scrolling is done by clicking the middle button and mousing up or
down.  If done over a link, Firefox mis-interprets this as intended to open a
new tab/window from the link.
*** Bug 249702 has been marked as a duplicate of this bug. ***
I would like to know how to ignore middle mouse clicks in Firefox 1.5.  I have my mouse settings in the windows control panel set globaly, and firefox is overriding these settings.  A simple user-pref, perhaps, a "middlemouse.ignore", could sovle this issue?
Assignee: bugs → nobody
Hey.

I do have a wheel, but still prefer clicking (enabling auto-scroll) when viewing most documents. When enabling the scroll, I usually remember to aim away from links and just about all images/flash, but when I'm done (turning auto-scroll off), I hit a link and I get a new tab.. very annoying. :(
I prefer clicking as well.

My last four mice all died from mouse-wheel overuse. My current mice(Logitech G5, Razer Krait) suffer from wheel-snapback, which after scrolling down, scrolls back up. I believe this was also caused by mouse wheel overuse.

Clicking and moving the cursor a tad to scroll is so much more convenient - except lately, pages are so full of links, images, and other ****, that I can't click anywhere without opening new tabs.

The other day I reported a valid post as inappropriate content while trying to scroll on some forums. :/
This was reported 8 years ago.  Any plans to fix?  How can you assume that clicking a javascript link that performs an ajax call to update part of the page should open a new page in a different tab using the original URL of the page.  Creating a duplicate of the existing page should not be the expected behavior of clicking with the middle mouse button. This interrupts the correct flow of our web app.
I confirm middlemouse.openNewWindow is ignored, always opens in new tab, never in new window.
We were able to update our custom extension to ignore middle mouse clicks (in case anyone is interested).

// prevent firefox from opening link in new tab when clicking with middle button
var c = document.getElementById('content');
c.addEventListener('mousedown', function(e) { ignoreMiddleButton(e); }, true); 
c.addEventListener('click', function(e) { ignoreMiddleButton(e); }, true); 


    ignoreMiddleButton  = function(event) {
    	if (event.button == 1) {
	    event.stopPropagation();
    	}
    };
This is an annoying misfeature on machines where the middle mouse button isn't a scroll wheel and scrolling is done by holding down the middle mouse button.
¡Hola Chris!

Found this one via https://bugzilla.mozilla.org/show_bug.cgi?id=1209894

Does fiddling with middlemouse.contentLoadURL help things? See http://kb.mozillazine.org/Middlemouse.openNewWindow

¡Gracias!
Alex
Flags: needinfo?(csthomas)
Whiteboard: [bugday-20151005]
Sorry, I can no longer help with this.
Flags: needinfo?(csthomas)
Hello Alex,
I tried your suggested setting and had no success. Here my summary again:

I use the Lenovo TrackPoint with HID conformant drivers (just the drivers supported by the OS). Scrolling the page works by clicking the middle button in Firefox. However when the scolling is initiated while the pointer is on a link something unexpected happens. It is unexpected because previous versions of Firefox did behave according to these adjustments in about:config (as if a bug from 10 years ago suddenly reappeared):

middlemouse.contentLoadURL = false
middlemouse.openNewWindow = false
middlemouse.paste = false
middlemouse.scrollbarPosition = true|false (makes no difference)

Actual results:

Firefox will open a new empty window when the scrolling is initiated on a link. With initiated I mean that I will click middle mouse to make Firefox aware that I want to start scrolling with the TrackPoint.

Expected results:

Firefox should behave according to the config settings:

1) it should not open a new window (obey middlemouse.openNewWindow = false)
2) it should not open a new tab (obey browser.tabs.opentabformiddleclick = false)

I just want to use middle mouse for scrolling.
14 years old bug...

Still an issue in 2018. FFS...


browser.tabs.opentabfor.middleclick = FALSE
middlemouse.contentLoadURL = FALSE
middlemouse.openNewWindow = FALSE

And yet middle clicking a link still opens it in a new window.
Yes, amazing. How hard must it be to force the flag to be respected?

Hi, I'd be happy to tackle this if it could be assigned to me. Thanks!

(In reply to Martin Koroknay from comment #19)

Hi, I'd be happy to tackle this if it could be assigned to me. Thanks!

Yes, please do! I would greatly appreciate it, and I'm sure many others too. :)

Can someone make an extension or something to allow this to happen? 15 year old bug! FIFTEEN!

Jesus christ, this bug is still around after 15 years.

I'm happy to have a crack at it; but since it's been around for 15 years I'm afraid I'm missing something.

My reason for wanting to disable it is that I'm using a touchpad that seems a bit sensitive and quite readily registers a three-finger tap which translates as a middle click. So sometimes I end up with lots of open tabs (or, if I set the opentab flag to false, new windows).

I think I've fixed it.

In mozilla-central/objdir-frontend/dist/bin/browser/chrome/content/browser/utilityOverlay.js I made the following modifications

--- a/browser/base/content/utilityOverlay.js    Wed Apr 08 15:26:13 2020 +0300
+++ b/browser/base/content/utilityOverlay.js    Thu Apr 09 00:51:16 2020 +0200
@@ -229,6 +229,11 @@
     true
   );
 
+  var middleUsesNewWindow = Services.prefs.getBoolPref(
+    "middlemouse.openNewWindow",
+    false
+  );
+
   // Don't do anything special with right-mouse clicks.  They're probably clicks on context menu items.
 
   var metaKey = AppConstants.platform == "macosx" ? meta : ctrl;
@@ -240,7 +245,7 @@
     return "save";
   }
 
-  if (shift || (middle && !middleUsesTabs)) {
+  if (shift || (middle && (!middleUsesTabs && middleUsesNewWindow))) {
     return "window";
   }

Depends on D70267

Attachment #9139318 - Attachment is obsolete: true
Attachment #9139319 - Attachment description: Bug 266985 - now obeys middlemouse.openNeWindow preference → Bug 266985 - now obeys middlemouse.openNewWindow preference
Attachment #9139318 - Attachment description: Bug 266985 - now obeys middlemouse.openNeWindow preference → Bug 266985 - now obeys middlemouse.openNewWindow preference
Attachment #9139318 - Attachment is obsolete: false
Attachment #9139319 - Attachment is obsolete: true
Assignee: nobody → sander.vandemoortel
Status: NEW → ASSIGNED
Attachment #9139318 - Attachment description: Bug 266985 - now obeys middlemouse.openNewWindow preference → Bug 266985 - Obey middlemouse.openNewWindow preference
Attachment #9139318 - Attachment description: Bug 266985 - Obey middlemouse.openNewWindow preference → Bug 266985 - now obeys middlemouse.openNewWindow preference
Attachment #9139318 - Attachment description: Bug 266985 - now obeys middlemouse.openNewWindow preference → Bug 266985 - Obey middlemouse.openNewWindow preference

Oh crap, are you about to get this fixed Blupp??

I mulled over it for fifteen years but then thought it'd be a good idea to submit a patch. The change worked for me, at least.

I believe the patch went through the first review stage now. This is my first time so I'm not sure what will happen next.

Stay tuned :)

Pushed by dgottwald@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/61f840b89d8f
Obey middlemouse.openNewWindow preference r=dao
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 77

Hello :) Somewhat pleased to report that in the current Nightly, the problem has gone away (on Linux). Windows doesn't seem to have the "don't open a new window" option at all.

Awesome! - I tried it out on Nightly (Windows) and it works.

The result I got was actually kind of different than I had hoped, since you still can't middle-click scroll on links, it just does nothing instead of activating Auto scroll- but this is still nicer than what we had before, and not related to this bug I guess :)

I browse ArtStation a lot and I have to use the scroll bar a lot since 90% of the page is filled with links lol.

do you mean you press the scroll wheel down to execute a middle click and then move your cursor downwards or upwards to scroll? This may be something that can be done but it is probably worth its own bug. Are you using any special software to aid with the scrolling like Logitech's mouse software? I haven't used Windows for a while - forget how it goes.

I have the G Hub. I think I'm actually going to tinker with that for a bit to see if I can muster up any macros to hack my way to what I want, or even try AutoHotkey. If I do I'll definitely let someone know :)

Is this real life?
Is this just fantasy?
This bug is finally fixed!
No escape from reality.

I guess we just had to wait for Blupp to be born, grow up and learn programming. Easy-peasy.

(In reply to Storm from comment #34)

Is this real life?
Is this just fantasy?
This bug is finally fixed!
No escape from reality.

I guess we just had to wait for Blupp to be born, grow up and learn programming. Easy-peasy.

Lmao, right? If he were born on the day this bug was posted, he could have easily learned programming by age 16 to fix this.

I'm going to believe this unless otherwise stated.

Flags: qe-verify+

Confirmed the issue with 66.0a1 (2019-01-08) on macOS 10.15.3
Flipping browser.tabs.opentabfor.middleclick reveals that this works now with - Windows 10, macOS 10.15.3, Ubuntu 20 with 77.0b3.

Status: RESOLVED → VERIFIED
Flags: qe-verify+

This change seems to have changed the default behavior. It took me quite a while to figure out why I could no longer open new windows by middle-clicking on links - a very common part of my usage pattern. (It still worked to open new tabs if configured that way, but I don't use tabs.)

middlemouse.openNewWindow doesn't seem to have been present in my configuration by default; adding it and setting it true seems to restore the old behavior.

Clarification: it's changed the default behavior when configured to open windows rather than tabs. FF before this change behaves differently from FF after this change, for my configuration.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: