Firefox: Middle-click triggers pop-up blocker


(ComputerDruid) #1

Middle clicking (to open in a new tab) on a topic triggers Firefox’s pop-up blocker.

This doesn’t make sense to me, given that middle clicking on an ordinary link opens in a new tab without this. Is discourse intercepting middle-clicks somehow?

Right-clicking on the link (if you aim VERY carefully), and selecting “Open in new tab” works as expected, but this is a pain compared to the much-easier-to-execute middle click.

Edit: You don’t actually have to aim carefully to right-click on the link, you have to right-click twice. The first right-click acts as if you’d right-clicked on the page, and the second one as if you’d right-clicked a link. Right-clicking before middle-clicking also works. This is really weird.


(Phil) #2

this was already discussed here and marked as fixed.

you’re right that it isn’t, however. this is so annoying.


(Jeff Atwood) #3

Someone else noted on BBS:

Looks like you’re encountering 657145 - window.open() during mousedown event creates popunder sometimes

Discourse calls window.open(href, “_blank”) on the mouseup event, which triggers what seems to be a race condition in Firefox. Doing the same on a click event does not trigger the bug that I can see.


(Phil) #6

that bug is about giving a window focus. our problem is that nothing happens at all when clicking a link.

and OP is right: after right-clicking once, middle-clicking works.


(Jeff Atwood) #7

For what it’s worth, this behavior is exclusive to Firefox.

We know of no other browser that has this problem: Safari, Opera, IE, Chrome… nobody.


(Phil) #8

i also don’t know any other site that has that behavior :wink:

is this the firefox bug you wanted to link to? because i don’t see the relation to this discourse bug


(Jeff Atwood) #9

We don’t know how to fix this “bug” because it is specific to Firefox. We are basically waiting for Firefox to fix their odd behavior in this area, unless someone can contribute a PR that does not regress in every other browser where we don’t have this problem.


(Phil) #10

it’s totally strange. middle clicking doesn’t work unless i right click first, but ctrl-clicking works. as of this line, both should work.

but we can’t expect firefox to fix it if we haven’t found a bug. afaics the bug you linked is something different. do you know the one which was filed for the misbehavior we’re talking about?


(ThiefMaster) #11

I think waiting for Mozilla to fix the behaviour in Firefox is a bad idea. It’s likely to take years (or a whole decade) like most simple-but-annoying bugs in Firefox…

I think I suggested some hacks that could fix it in another thread some months ago - what about using one of those in Firefox?


(Sam Saffron) #12

why not send a PR through ?


(Adam Davis) #13

Still an exceptionally annoying issue. Delicious had this problem for one month, then fixed it.

It may well be that Firefox is at fault, but that’s little comfort to those of us who use middle click and firefox extensively to browse forum content.


(Andrew) #14

On my install of FF25, middle clicking will trigger the pop-up blocker and ctrl-clicking opens the link in two new tabs.

Wouldn’t having the on-click handler return true allow the browser to open the new tab by itself?


(Mosquito) #15

I am also getting this problem in FF25. I see in other posts this has been fixed. Could this be attributed to plugins?

Of note, I have Firebug, FireFTP, Selinium IDE, Tamper Data, and Web Developer installed.


(Mosquito) #16

I took the time to set up a clean Windows 7 VM just to test this.

  1. Set up brand new Windows 7 Professional VM and update Windows
  2. Install Firefox from getfirefox.com. At the time of this post, that got me 25.0.1
    http://i.imgur.com/UhJVQi6.png
  3. Check to ensure there are no Extensions or Plugins (there are not)
    http://i.imgur.com/9yVdfm7.png
    http://i.imgur.com/8zACqJ6.png
  4. Load meta.discourse.org and attempt to middle click open a link from within a topic. I selected this topic and the first reply has a link I wish to test.
  5. Middle click on the “DNS record” text
  6. Receive an error stating that Firefox prevented a pop-up window. However, the count of the number of times the link has been clicked DID increase by 1.
    http://i.imgur.com/GDuY0J9.png

A few other relevant, default, settings (I didn’t modify any of these):

  1. Firefox is set to open new windows in new tabs
    http://i.imgur.com/nXYZXXe.png
  2. Firefox is set to block popups
    http://i.imgur.com/CdPKM6T.png
  3. There are no exceptions to this block
    http://i.imgur.com/soh0iOz.png

Summary
A fresh install of Firefox on a fresh install of Windows blocks the option to middle click open all links from within a topic. This block does not occur when selecting topics from the topic list, it is just to links from within a topic.


(Jeff Atwood) #17

Yep, it is a known issue, sadly 100% specific to this web browser.

For now, the answer is #3 add an exception in Mozilla for the site.


(Mosquito) #18

Thanks for the response @codinghorror.

Is there a way link handling can be modified in topic to be the same as on topic list page? What is being done with links in the posts that makes them new tab resistant, but I can open 15 different topics in new tabs without an issue?


(Adam Davis) #19

That doesn’t work. While I no longer get the popup blocking message, the middle-click-to-scroll feature of windows activates as though the link is not really a link.

Adding a popup blocking exception to windows in firefox still results in me not being able to middle click links inside topics.

And while there are a myriad of other minor reasons, this is a big reason why I no longer casually visit here or any other discourse site - the website is broken and it’s very frustrating to use. While you can hold up your hands and indicate that it’s not your fault, the reality is that it’s going to be broken for a certain subset of user that use firefox and middle click to open a new tab, and it’s going to push them away.

It’s a completely valid decision to choose not to support a browser fully due to bugs, but you should at least understand that these minor issues can act as big levers in user happiness.

The easy fix would be to stop attempting to count link clicks on firefox until you find a workaround, or firefox resolves the issue.


(Bill Ayakatubby) #20

How does Google track clicks on its search results? I never have a problem middle-clicking them.


(Jeff Atwood) #21

Well let’s see. I never use Firefox because Chrome is so much better (for example, Firefox does not have decent support for basic copying and pasting of images, among dozens of other quirks and omissions), but I’ll give it a shot:

I click on the link in a new install of Firefox and get the expected (and totally specific to this lone browser on the planet) “ooo, this is pop-up!” which is 100% incorrect.

I then allow an “exception” for this site to “allow pop-ups”, which is again, 100% incorrect since that link does not result in a pop-up in any way, shape or form… but it is something that only Firefox demands. No other browser in the entire world makes this mistake.

I then middle click the link, and it opens in a tab as I would expect.

Now, what DOES happen after that is middle-clicking subsequent links in the same topic results in the ‘move’ cursor. That is definitely a bug and I’ll see if we can fix that.

p.s. firefox is literally quirkier than Internet Explorer for us. Not even joking at all. So you’ll pardon me if I have little enthusiasm for this browser at this point in my life. You should use Chrome, it’s just plain better in so many ways. Hell, use Internet Explorer 11, that’s also a better browser than Firefox at this point.


(Jeff Atwood) #22

They rewrite all URLs into a different form, which means copying and pasting URLs gives you horrid gobbledygook – right click and copy a link on a page of search results, and instead of http://www.example.com you get

http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&ved=0CDYQFjAB&url=http%3A%2F%2Fwww.speedtest.net%2F&ei=xAmqUv2nINjAoASw_4HgBQ&usg=AFQjCNHr6YyAkpiq37Q1AYAxF9ZW18CZrw&sig2=ZNPWHQlg_mKWHlBKPzP-Mw&bvm=bv.57967247,d.cGU

Try it yourself.