36

When reviewing in the Close Vote queue, and prompted with a modal to pick an option, some of the text has links that help explain the rationale for the reason. If I click these links, my browser opens the target page in a new tab. Great!

When reviewing in the Low Quality queue, and prompted with a modal to pick an option, clicking similar links opens the target page in the existing tab. Not great!

Example of the types of links I'm talking about:

enter image description here

Please adjust the Low Quality queue modal links to open in a new tab, like the CV Queue.

7
  • 2
    Yes, and IMO images should also target new tabs. One option would be to right click and choose : open link in a new tab, but this is annoying. Dec 14, 2017 at 20:27
  • 6
    @AntoinePelletier Another option is to cmd + click on the link (or ctrl + click on Windows I think) which is way more efficient than right-clicking.
    – Keiwan
    Dec 14, 2017 at 21:05
  • 1
    @Keiwan Indeed ! Wow, we never stop learning, that's what they say ! Dec 14, 2017 at 21:11
  • 17
    I almost always use the middle button mouse click, which opens in a new tab.
    – Davy M
    Dec 14, 2017 at 21:50
  • 7
    @DavyM it's kind of irrelevant, as here the issue is consistency for left click behavior.
    – Cœur
    Dec 15, 2017 at 6:43
  • 3
    @AntoinePelletier: you mean image thumbnails inside question / answer posts? I don't think it's good to remove the option of clicking an image and then using back (alt+left, or mouse button 4 or 5) to return to SO. If I want a link to open in a new tab, I do that with middle click or ctrl click instead of hoping that whoever designed a certain web page overrode the default behaviour of links. Dec 15, 2017 at 6:52
  • 2
    WHAT ? mouse wheel click now ? OK just forget everything I said, just to think I developed all my websites without knowing these features... i feel totally humiliated. I now know what i'm going to answer when clients ask for link to open new tabs... May the science show me mercy... Dec 15, 2017 at 14:49

2 Answers 2

4

You can use the following userscript to have all links in Stack Exchange popups open in new tabs.

// ==UserScript==
// @name          Stack Exchange popups in new tab
// @namespace     MakyenStackExchangeAdjustments
// @description   Make links in Stack Exchange popups open in new tabs
// @match         *://*.stackoverflow.com/*
// @match         *://*.superuser.com/*
// @match         *://*.serverfault.com/*
// @match         *://*.askubuntu.com/*
// @match         *://*.stackapps.com/*
// @match         *://*.mathoverflow.net/*
// @match         *://*.stackexchange.com/*
// @grant         none
// @version       1.0.0
// ==/UserScript==

(function() {
    'use strict';
    $(document).ajaxComplete(() => $('.popup a').attr('target', '_blank'));
})();

I haven't extensively tested this. However, for the testing I did do, it worked well (review popup, flag popup).

0
-8

No links ever should have target=_blank attribute. It is purely the user's decision whether to open new tabs and windows or reuse the existing one. This is less of an issue in Firefox, where users can override this behavior, but most browsers don't have this option. However, in almost all browsers, there're always multiple ways to open links in new tabs and windows:

  1. clicking the middle mouse button (or the mouse wheel) on a link;
  2. clicking the left mouse button on a link while holding Ctrl or Ctrl+Shift;
  3. selecting the appropriate option from the link's context menu;
  4. dragging a link into the title bar;
  5. mouse gestures (usually requires addons).

The problem with target=_blank attribute is that it takes away user's choice.

6
  • 1
    This is the wrong; links should open in a blank window by default when they are a link to a resource on another page. When clicking through a form or anywhere you want an unbroken experience, open the link in the same page. In the opposite case, like this, where you have a modal on top of a window that has links to other information, it makes no sense to have a link from a modal take you away from the page behind the modal you just opened.
    – TylerH
    Dec 17, 2017 at 2:49
  • I am used to the behavior where I click a link, and it replaces current page with the target of the link. Except for some weird links, which annoyingly open a new window or a tab. I as a user don't know what a "modal" is, and don't expect special behavior from it.
    – anatolyg
    Dec 17, 2017 at 12:37
  • In Chrome, Firefox and Internet Explorer you can drag the link into the title bar and that will always open the link in the same tab. Dec 17, 2017 at 12:39
  • 1
    @DonaldDuck I've been wondering for literally years what link dragging, which ruins text selection, is for. Now, thanks to you, I know one thing it can be useful for. / Tested opening links using various methods. Funny, Chrome now always respects middle clicks on achors with onclick handlers (doesn't fire event?), but Firefox switched to old Chrome's behavior...
    – Athari
    Dec 17, 2017 at 15:27
  • 1
    @anatolyg a modal, at least in the web, is any popup window that typically isn't a true 'window' but an element that takes the appearance of a new window. The point of that behavior is that it indicates anything you do in the modal won't affect the state of the underlying page.
    – TylerH
    Dec 17, 2017 at 18:45
  • @Athari Chrome switched to sending clicks from buttons other than button 0 through auxclick events, instead of click. Thus, if a page wants to capture button clicks from other than button 0, they need to specifically work at it.
    – Makyen Mod
    Mar 10, 2018 at 1:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .