# How to stop middle click opening URL in Firefox

**URL:** <https://boards.straightdope.com/t/how-to-stop-middle-click-opening-url-in-firefox/574707>\
**Category:** Factual Questions\
**Created:** [March 14, 2011, 10:14pm UTC](https://boards.straightdope.com/t/how-to-stop-middle-click-opening-url-in-firefox/574707 "2011-03-14T22:14:55Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZenBeam](https://avatars.discourse-cdn.com/v4/letter/z/3ab097/32.png) [@ZenBeam](https://boards.straightdope.com/u/ZenBeam)\
**Post date:** [March 14, 2011, 10:14pm UTC](https://boards.straightdope.com/t/how-to-stop-middle-click-opening-url-in-firefox/574707/1 "2011-03-14T22:14:55Z")

</div>

**Not** the “middle click opens link in a new tab feature”. I want that. If I middle-click _not_ on a link, Firefox tries to open whatever is in my clipboard as a URL.

As an example, if I copy “wikipedia” and middle click somewhere, [http://www.wikipedia.org/](http://www.wikipedia.org/) opens up.

Sometimes my wheel moves when I try to middle-click, and instead of a new tab of the link I was aiming at, another page opens in place of the one I’m looking at, which is a pain.

I have no idea whether this is a Firefox setting or a mouse setting, or what. How do I turn this off?

I’m on the most recent Linux Mint, Firefox 3.6.13, if it matters.

---

<div class="post-metadata">

**Author:** ![Omphaloskeptic](https://avatars.discourse-cdn.com/v4/letter/o/bcef8e/32.png) [@Omphaloskeptic](https://boards.straightdope.com/u/Omphaloskeptic)\
**Post date:** [March 14, 2011, 10:30pm UTC](https://boards.straightdope.com/t/how-to-stop-middle-click-opening-url-in-firefox/574707/2 "2011-03-14T22:30:03Z")

</div>

about:config, set [middlemouse.contentLoadURL](http://kb.mozillazine.org/Middlemouse.contentLoadURL) to false.

---

<div class="post-metadata">

**Author:** ![ZenBeam](https://avatars.discourse-cdn.com/v4/letter/z/3ab097/32.png) [@ZenBeam](https://boards.straightdope.com/u/ZenBeam)\
**Post date:** [March 14, 2011, 10:51pm UTC](https://boards.straightdope.com/t/how-to-stop-middle-click-opening-url-in-firefox/574707/3 "2011-03-14T22:51:00Z")

</div>

Wonderful! Thanks!

\<Happily middle-clicking all over the page and nothing happens\>

---

<div class="post-metadata">

**Author:** ![dtilque](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@dtilque](https://boards.straightdope.com/u/dtilque)\
**Post date:** [March 15, 2011, 2:55am UTC](https://boards.straightdope.com/t/how-to-stop-middle-click-opening-url-in-firefox/574707/4 "2011-03-15T02:55:58Z")

</div>

How about if I want to disable the mousewheel button altogether? Including in other applications, such as Thunderbird email. Will toggling off all the middlemouse parameters do that?

Everyone once in a while I’ll be scrolling with the mousewheel and accidently click the button. If it’s in a window where I’m composing an email, for example, it pastes whtever is in the clipboard right there. Which is never what I want to happen. Based on the name, I would guess that toggling off middlemouse.paste would stop this. What about toggling off the other two parameters?

---

<div class="post-metadata">

**Author:** ![Tim\_T-Bonham.net](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@Tim\_T-Bonham.net](https://boards.straightdope.com/u/Tim_T-Bonham.net)\
**Post date:** [March 15, 2011, 4:09am UTC](https://boards.straightdope.com/t/how-to-stop-middle-click-opening-url-in-firefox/574707/5 "2011-03-15T04:09:35Z")

</div>

> [@dtilque](#):
>
> How about if I want to disable the mousewheel button altogether?

You can do that for the whole system by disabling the detection of the mousewheel altogether in your mouse hardware driver.

Control Panel - System - Hardware - Device Manager - Mice & Pointing devices.

---

<div class="post-metadata">

**Author:** ![dtilque](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@dtilque](https://boards.straightdope.com/u/dtilque)\
**Post date:** [March 15, 2011, 7:25am UTC](https://boards.straightdope.com/t/how-to-stop-middle-click-opening-url-in-firefox/574707/6 "2011-03-15T07:25:34Z")

</div>

> [@t-bonham@scc.net](#):
>
> You can do that for the whole system by disabling the detection of the mousewheel altogether in your mouse hardware driver.
> 
> Control Panel - System - Hardware - Device Manager - Mice & Pointing devices.

I forgot to mention that I’m running Linux. Can’t seem to find a control panel.

Besides which, I still want the mousewheel to work, I just don’t want the button to do anything.

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [March 15, 2011, 7:37am UTC](https://boards.straightdope.com/t/how-to-stop-middle-click-opening-url-in-firefox/574707/7 "2011-03-15T07:37:31Z")

</div>

> [@dtilque](#):
>
> I forgot to mention that I’m running Linux. Can’t seem to find a control panel.
> 
> Besides which, I still want the mousewheel to work, I just don’t want the button to do anything.

Install imwheel and play with that for a bit.

How you install software is up to your distro. Are you running Ubuntu, Fedora, or something else?

---

<div class="post-metadata">

**Author:** ![psychonaut](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/psychonaut/32/4655_2.png) [@psychonaut](https://boards.straightdope.com/u/psychonaut)\
**Post date:** [March 15, 2011, 11:53am UTC](https://boards.straightdope.com/t/how-to-stop-middle-click-opening-url-in-firefox/574707/8 "2011-03-15T11:53:50Z")

</div>

Check your distribution’s documentation for how to do this through the configuration utility. If you can’t find it, then you can disable the middle button by directly editing your X Windows configuration files. On most modern systems this will be in /etc/X11/xorg.conf. If you see a line that looks something like this:

Option “Emulate3Buttons” “on”

then replace it with this:

Option “ButtonMapping” “1 1 3 4 5”

On most mice this will turn the middle button into a left button, so middle-click has the same effect as left-click. Or you could try the following:

Option “ButtonMapping” “1 0 3 4 5”

That might disable the middle button completely.

Note that you may need to restart your windowing environment for this to take effect. Depending on your system, this may be accomplished by logging out and back in again, or you may need to restart the whole machine.

---

<div class="post-metadata">

**Author:** ![Kyrie\_Eleison](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/kyrie_eleison/32/7682_2.png) [@Kyrie\_Eleison](https://boards.straightdope.com/u/Kyrie_Eleison)\
**Post date:** [March 15, 2011, 2:22pm UTC](https://boards.straightdope.com/t/how-to-stop-middle-click-opening-url-in-firefox/574707/9 "2011-03-15T14:22:25Z")

</div>

> [@psychonaut](#):
>
> If you can’t find it, then you can disable the middle button by directly editing your X Windows configuration files. On most modern systems this will be in /etc/X11/xorg.conf.
> 
> [snip]
> 
> Note that you may need to restart your windowing environment for this to take effect. Depending on your system, this may be accomplished by logging out and back in again, or you may need to restart the whole machine.

Regardless of distribution, you can accomplish this with xmodmap with no restart required. Be aware that if you change xorg.conf, you’re changing the behavior for every user. You can use xmodmap to change the behavior for just yourself, which might be nice if more than one person uses the machine.

---

<div class="post-metadata">

**Author:** ![psychonaut](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/psychonaut/32/4655_2.png) [@psychonaut](https://boards.straightdope.com/u/psychonaut)\
**Post date:** [March 15, 2011, 3:25pm UTC](https://boards.straightdope.com/t/how-to-stop-middle-click-opening-url-in-firefox/574707/10 "2011-03-15T15:25:04Z")

</div>

> [@Kyrie\_Eleison](#):
>
> Regardless of distribution, you can accomplish this with xmodmap with no restart required. Be aware that if you change xorg.conf, you’re changing the behavior for every user. You can use xmodmap to change the behavior for just yourself, which might be nice if more than one person uses the machine.

This is all true. But keep in mind that using xmodmap isn’t persistent – if you use that it will remap the mouse button only for the current session. If the OP wants it to be disabled permanently, he’ll either have to edit xorg.conf (which is fine for a single-user machine), or he’ll have to put the xmodmap command in some file which gets executed upon login.

---

<div class="post-metadata">

**Author:** ![dtilque](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@dtilque](https://boards.straightdope.com/u/dtilque)\
**Post date:** [March 16, 2011, 6:12am UTC](https://boards.straightdope.com/t/how-to-stop-middle-click-opening-url-in-firefox/574707/11 "2011-03-16T06:12:20Z")

</div>

I’m running Centos. I’m the only one who uses it, so I have no problems changing system parameters. I’m not sure what the config utility is for this. Googling says I should have a system-config-mouse utility, but I don’t seem to have it.

I checked the xorg.conf file and it doesn’t have a section for the mouse. I suppose I could add one, since the syntax seems simple enough. Something like this:

```auto

Section "InputDevice"
          Identifier "Mouse0"
          Driver "???"
          Option "ButtonMapping" "1 0 3 4 5"
EndSection

```

I’m not sure what to put in the “???” field and I suspect it needs more options, but I don’t what they would be. Also I’d need to add another InputDevice line in the ServiceLayout section, but that’s obvious. Any ideas on this?

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [March 16, 2011, 8:04am UTC](https://boards.straightdope.com/t/how-to-stop-middle-click-opening-url-in-firefox/574707/12 "2011-03-16T08:04:37Z")

</div>

nvm

---

<div class="post-metadata">

**Author:** ![psychonaut](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/psychonaut/32/4655_2.png) [@psychonaut](https://boards.straightdope.com/u/psychonaut)\
**Post date:** [March 16, 2011, 9:09am UTC](https://boards.straightdope.com/t/how-to-stop-middle-click-opening-url-in-firefox/574707/13 "2011-03-16T09:09:02Z")

</div>

> [@dtilque](#):
>
> I’m running Centos. I’m the only one who uses it, so I have no problems changing system parameters. I’m not sure what the config utility is for this. Googling says I should have a system-config-mouse utility, but I don’t seem to have it.

Yes, [the CentOS manual](http://www.centos.org/docs/4/4.5/System_Administration_Guide/ch-mouseconfig.html) does mention that you should run this command from the terminal. What happens when you run it? Does it say “command not found”?

> [@](#):
>
> I checked the xorg.conf file and it doesn’t have a section for the mouse.

That’s highly unusual. Are you sure it’s not one of the existing InputDevice sections?

> [@](#):
>
> Something like this:
> 
> ```auto
> 
> Section "InputDevice"
> Identifier "Mouse0"
> Driver "???"
> Option "ButtonMapping" "1 0 3 4 5"
> EndSection
> 
> ```
> 
> I’m not sure what to put in the “???” field and I suspect it needs more options, but I don’t what they would be.

Usually “mouse” works for the Driver field, though it depends on your mouse model.

Really, your best bet is probably to get the system-config-mouse utility up and running. Find out where on your system it is, and if it’s not there, install it. I’ve never used CentOS, but this utility sounds like it may allow you to configure the action associated with the buttons, or if not, to fool your system into thinking it’s got a two-button mouse.

If none of this helps, you may have better luck posting this question on a forum dedicated to CentOS, such as [the official forums](http://www.centos.org/modules/newbb/), or maybe on a generic GNU/Linux one such as comp.linux.misc.

---

<div class="post-metadata">

**Author:** ![dtilque](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@dtilque](https://boards.straightdope.com/u/dtilque)\
**Post date:** [March 16, 2011, 10:43am UTC](https://boards.straightdope.com/t/how-to-stop-middle-click-opening-url-in-firefox/574707/14 "2011-03-16T10:43:43Z")

</div>

> [@psychonaut](#):
>
> Yes, [the CentOS manual](http://www.centos.org/docs/4/4.5/System_Administration_Guide/ch-mouseconfig.html) does mention that you should run this command from the terminal. What happens when you run it? Does it say “command not found”?

Yes. One thing is that I’m using Centos 5.3 and that manual is for an earlier version. Possibly they had to remove it for some reason in the latest version. Or perhaps I just didn’t install it when I installed the system.

> [@](#):
>
> That’s highly unusual. Are you sure it’s not one of the existing InputDevice sections?

I’m certain. The only InputDevice section is for the keyboard.

> [@](#):
>
> If none of this helps, you may have better luck posting this question on a forum dedicated to CentOS, such as [the official forums](http://www.centos.org/modules/newbb/), or maybe on a generic GNU/Linux one such as comp.linux.misc.

Yeah, I think I’d better. Thanks for the help.
