Discourse prevents links being opened in new tabs?

Continuing the discussion from Design suggestion box:

When I middle click on any link on any other site, a new tab is immediately opened, because that’s how I’ve configured firefox. Here I just get “firefox prevented this site from opening up a pop-up window”.

I don’t want any new windows to be created without me specifically and intentionally creating them! They mess up the mental and visual categorization I use to optimize my workflow. On any other site I just middle-click when I want a new tab, left-click when I want to follow the link in the current tab, and right-click/select-new-window-from-choices if I want to open a new window.

Not sure what is going on to cause this, I suppose I better go look at the HTML… nope, the “Design Suggestion Box” link immediately above displays the behavior, but it’s just a garden variety a/href type link. Maybe it’s in the CSS?

EDIT: Jeff Atwood has a workaround here - pointing out that since discourse/bb don’t plan on using any real popups, telling firefox to allow popups for this site should provide the expected middle-click behavior.

FYI, I have since learned that you can alleviate part of the problem in Firefox by going to about:config and setting everything under dom.disable_window_open_feature to True. But that will just make the new window act like a perfectly ordinary window if you choose to open it and does not eliminate the inconsistent middle-clicking behavior.

I’m MacOS, so I cmd+click to open links in a new tab, which never gives me a problem. Maybe y’all need to have the box checked on your profiles? Maybe that would goof it up worse ¯ \ _ (ツ) _ / ¯

Even if that does work, I’d have to log in to make it work. It seems that it should be default behavior.

EDIT: Checking that box does not change middle-click behavior.

Here are my settings, unchanged for quite some time:

When I middle-click a link here (using FF), instead of it opening in a new tab in the background, it opens in a new tab and switches focus to it if it’s an external link. This is annoying.

I also find that links can only be clicked once before refreshing the page; this isn’t such a big deal but it’s still dodgy.

Firefox has a very, very strange idea of what “popup blocking” means and has some erratic behavior as a result.

Opera, Chrome, Safari, and IE don’t exhibit that particular behavior so we chalk it up to Firefox oddities.

By default, middle-clicking a link in Firefox opens it in new tab but does not focus it. It appears that Discourse adds some redundant code that handles middle-clicks and explicitly instructs the browser to do what it already was going to do, which is caught by the popup blocker as some sort of suspicious action. Even after dismissing the popup notification, middle-click behavior is not right - the new tab receives focus, as pointed out by @Kimmo. Why can’t the redundant code simply be disabled?

Since Firefox is the only browser that exhibits this behavior – it does not happen on Opera, IE, Chrome, or Safari – we were hoping Firefox would fix their bug.

Do other browsers somehow benefit from the explicit handling of middle-clicks?

What we’re trying to avoid is rewriting all links ala t.co url shorteners to track clicks, since that’s just… nasty. Firefox is the outlier in how it behaves at the moment, I am not aware of any other browser that has this problem.

I’ll probably just adapt and end up considering it a feature, if only I can remember the criteria.

Conversely, no other site I use on a regular basis behaves like this when middle-clicking to open a link. Perhaps, in the name of usability, Discourse could add a Firefox exception, so that when it detects that the user is viewing with Firefox, it loads a version that doesn’t include the redundant code.

1 Like

Middle clicking a link in a post to open it in a new tab works the first time but then refuses to work after that.

Related to the above, 100% Firefox specific. Works fine in every other browser I’ve ever tested.

So shrug thats it? oh well…
You’ve said on other threads that discourse is still in development, but if all you’re going to do when people point out bugs (and yes, if you are adding something to links that makes them not work the same as every other link on the web then the bug is in your code, not firefox) and make suggestions is dismiss it, it sounds to me like its gone past “in dev” and is now “legacy, no longer supported”

We’ve looked a number of times, and we haven’t been able to find a workaround for Firefox’s wonky pop up “protection” issues (that doesn’t break all the other browsers which work fine). It’s open source code, so if you’d like to contribute a fix, please do!

What “workaround”? As others have said this is behavior I’ve only witnessed on the BBS so there’s obviously something going on with links originating here that’s not normal. Whatever that is is causing the problem.
I’m not a software developer so I’m not even going to look at the open source code. You’re asking for input and I’m trying to give it but if all you’re going to do when you get criticism is throw a tantrum, push out the code and say “FINE! you do better!” then I think we’re done here, and perhaps you should say development is over and this is the release candidate.

1 Like

Oh and by the way, the same thing happens in IE11

I can’t repro – when I middle-click a link in IE11, it opens in a new tab. Do you have repro steps?