Mouse Middle click = open link in the same instead of a new tab?


#1

Hello!

Something happened to the forum? In the past I could use middle click to open a link in a new tab, now the ink is opened in the same tab?


#2

Sounds more likely to be a problem with your computer than a problem with the forum.
Middle-clicking is working fine for me.


#3

Tested it with FF and SRWare, will test with some other browsers


#4

Is there any particular thread this is happening on? I’ve given this a try with links on a few threads and also the top Home/News/Reviews links. It opened the link each time in a new tab with Firefox, Edge and Chrome.

Usually I hold the control key down when left-clicking a link to open it in a new window. This is mainly due to laptop touchpads missing the middle-click and using the odd PC where the scroll wheel click displays a zoom-magnifier.


#5

Here´s a topic I post links to the writer-specific topic. Everytime I middle click one of these links the link will be opened in the active tab

It also happened if I hold the control key down when left-clicking

It happens also with other links in the topics, which linked to pages outside myce

But if I click a topic in a fora directory like here

The links will be opened in a new tab, like usually


#6

Thanks, I can now see the issue at my end with your top link, i.e. Ctrl + Click still opens it in the same tab.

Unfortunately it looks like this bug is in the Discourse code, likely introduced since its last update. Based on toggling JavaScript event listeners in Chrome, the culprit seems to be in the following block of code:

    this.$().on('mouseup.discourse-redirect', '.cooked a, a.track-link', function (e) {
    // bypass if we are selecting stuff
    var selection = window.getSelection && window.getSelection();
    if (selection.type === "Range" || selection.rangeCount > 0) {
      if ((0, _utilities.selectedText)() !== "") {
        return true;
      }
    }

    var $target = $(e.target);
    if ($target.hasClass('mention') || $target.parents('.expanded-embed').length) {
      return false;
    }

    return _clickTrack.default.trackClick(e);
  });

From a quick check on Discourse’s bug report forum, this issue was also reported there by someone else, so hopefully they’ll fix it in their next update.


#7

Thank you for the info :slight_smile:


#8

So you weren’t imagining things after all; that’s good to know! :grin: