28

I use the middle mouse button to open links in new tabs and to close tabs.

But sometimes, clicking the middle mouse button opens links in the current tab instead of in a new tab. It's not random - I noticed it usually happens when I click on popup links - such as thumbnails or links that open an image in a popup window (just like here).

I checked and this problem doesn't exist in Firefox (14.0.1).
My Google Chrome version is 22.0.1229.94.

Why does that happen?
Can I force the middle mouse button click to always open links/images in a new tab?

amiregelz
  • 8,099
  • 12
  • 48
  • 58

3 Answers3

23

This happens because a so called lightbox script is attached to the links. So if you've activated javascript execution (which is the default on popular browsers), the lightbox script attaches to the images and opens them in a neat in-page viewer. This script seems to be programmed to react to the left and middle mouse buttons (which definitely is not good style).

There are several things you could try:

  • Disable javascript completely or for single pages (doesn't sound like a good solution nowadays).
  • Use the right mouse button and choose Open Link in New Tab.
  • Install a browser extension like Link Fixer or Fix Chrome middle click behavior (which I haven't tested though).
Daniel Calliess
  • 381
  • 2
  • 5
  • 1
    middle click mini is great! Thanks for the link. But why does it work on Firefox by default? I have javascript installed, and clicking the mouse middle button in Firefox *always* opens links in a new tab. – amiregelz Nov 06 '12 at 14:25
  • 2
    As picospuch writes in his answer to your question, this may depend on how the browser handles mouse input events. Is looks like Firefox doesn't tell the script inside the webpage about middle mouse clicks on links but rather handles the click event itself. – Daniel Calliess Nov 06 '12 at 14:36
  • 1
    Middle click mini did the trick on the page that made me look for answers to this problem. – That Idiot Jan 06 '16 at 12:58
  • Worked for me on Chromium / Linux. Thanks! – AtomHeartFather May 14 '16 at 11:19
  • 1
    middle click mini link is dead. Answer out of date. – Andrew Dec 09 '20 at 21:13
  • For some reason, middle-click opens a new tab from Google search results in Chrome on my Windows desktop but not in Chrome on my Ubuntu laptop. Link Fixer didn't work on the laptop and wasn't needed on the desktop. – Ray Woodcock Feb 25 '22 at 15:32
4

I wrote a Chrome (and Firefox) add-on called link-fixer to fix this. You can install from the Chrome Web Store.

Restores consistent ctrl+click, shift+click, cmd+click and middle-click behaviour when clicking links.

The default behaviour of ctrl+click, shift+click, cmd+click (on macOS) and middle-click when clicking on links is to open the link in a new tab or new window.

This behaviour is sometimes broken by careless developers.

This add-on restores the default behaviour, ensuring the modifier keys always cause links to open in a new tab.

Once installed, middle click and ctrl+click (as mentioned in other answers) will work as you'd expect across all sites.

danielnixon
  • 321
  • 2
  • 6
  • Although I was skeptical after googling and trying out several different methods and extensions, FINALLY, this works like a charm! Thank you! Also, I just confirmed that it does not interfere with the ordinary left-click events used by page designers either! – johnlee Mar 24 '23 at 08:08
4

No, you can't. This is because of the different process of middle click between firefox and chrome. You know that, browser must run code from the webpage(it's so-called javascript) and of course from itself. the code in the webpage may firstly get the event of your middle click on chrome. firefox may open a new tab and not pass the event to the webpage. It depends on implementation of browser. I think they are both right.

BTW, you can always use CTRL + click to open a link in new tab.

picospuch
  • 59
  • 3
  • 1
    While CTRL+click is good if you have problems with your middle button itself, it's not immune to the javascript issues described in the other answer. See, for example, the "links" to comments on http://googlechromereleases.blogspot.com/ where CTRL+click runs the js (including navigation) in the same tab. – Michael Urman Aug 26 '16 at 11:47