3

Most of the time when I follow a user's link, I just want to see their site, look it over, then return to answer their question (not leave SO completely and not come back). Could we make the links users post open in a new window please?

EDIT: I originally wanted this implemented because it's what some other sites did, but I now definitely prefer SO's way. If I want to open a new tab, I middle-click/control-click (or whatever); if not, I just click. I'm in control of what happens. Would never want to go back now.

16
  • 22
    Shot down repeatedly during the UserVoice era. Thankfully. I expect my programs to leave me in control. Please stop trying to mess that up. Aug 20, 2009 at 20:54
  • 14
    @dmckee That's why it should be an option, so people can be in control to use it or not
    – Andrija
    Aug 20, 2009 at 21:02
  • 4
    User option. Absolutely. I just went looking for it in the assured belief that surely it would be there. Most advanced websites these days will open a new tab for external links (depending on the context).
    – noelicus
    Nov 30, 2011 at 12:15
  • Yes or No, SO is not consistent in that case. Try clicking an "internal" link from ask question page, you are off to a surprise :) So SO pleases both :D
    – nawfal
    Jul 30, 2012 at 2:13
  • 9
    @Andrija, it is an option -- provided by your browser. Mar 29, 2013 at 17:11
  • 3
    Use your mouse's middle button to open links in new tabs/windows (which one it'll be is a browser setting). Problem solved.
    – yannis
    Jun 5, 2013 at 14:10
  • 1
    Also people are automatically clicking the link but then they're redirected. I think this is a lot better to set it to the left mouse button using target="_blank" Jun 5, 2013 at 14:13
  • You could write yourself a userscript which appends the target to all links on the site, or certain for that matter...or I could write it if you tell me on what links you want that...in that case I'd write it less for you, but more because it sounds like an interesting script to write. Jun 5, 2013 at 14:14
  • 5
    This would be an issue in the time where mouses didn't have middle mouse button. Jun 5, 2013 at 14:15
  • 1
    @ʞunɥdɐpɐɥd: mice had middle mouse buttons for a long time (that's actually the mouse from my first PC). Jun 5, 2013 at 14:17
  • 1
    So, I had the same suggestion - links should be opened a new window - not forcing me to leave the SO site each time I want to view a link. However, after reading the comments on here... I guess I'd have to agree that CTRL-clicking a link is probably the best option.
    – Charlie74
    Dec 4, 2013 at 15:37
  • 2
    I need it and link should open in new tab
    – mujaffars
    Aug 11, 2015 at 9:04
  • 2
    @ʞunɥdɐpɐɥd I've never owned a mouse with a middle mouse button. Unless you are referring to pressing the scroll wheel in, which is a very awkward and uncomfortable interaction (especially when the link you are trying to "click" is scrolling around underneath you as you are trying).
    – devios1
    Sep 14, 2015 at 17:52
  • 2
    This should be a user end setting. Yes yes yes.
    – user308037
    Oct 6, 2016 at 14:36
  • 1
    Annoying thing. It is very uncomfortable. Some links should open in new tab other in the same tab.
    – holden321
    Apr 18, 2019 at 16:44

18 Answers 18

76

Just hold down Ctrl when you click - or right-click etc... or in some browsers Shift + click... and so on...

7
  • 47
    Don't forget middle-clicking (if the scroll wheel acts like a third button).
    – AnonJr
    Jul 5, 2009 at 12:14
  • 1
    Or right-click > copy link location, ctrl+t, click the address bar, ctrl+v, enter...
    – Sampson
    Jul 31, 2009 at 18:19
  • I'm running Vista here with Firefox. All I have to do is right-click and hit the popup menu if I want to open in a new window or tab. Aug 20, 2009 at 20:54
  • Or in chrome right click and open in a new tab
    – n0pe
    Aug 10, 2011 at 15:23
  • 3
    I doubt any of this is news to the asker. Personally, I EXPECT sites with EXTERNAL links put in for reference to open a new tab if I'm using a tabby browser.
    – noelicus
    Nov 30, 2011 at 12:15
  • 4
    @noelicus as per laalto's anwser, that expectation isn't universal Nov 30, 2011 at 12:39
  • @MarcGravell Yes, I know! I actually advocate it should be an option that defaults to "standard" link behaviour, like it was in the 80s.
    – noelicus
    Dec 1, 2011 at 11:48
37

The website should not open new windows. As already mentioned, you can do it yourself when you want.

Jakob Nielsen puts it nicely:

Opening up new browser windows is like a vacuum cleaner sales person who starts a visit by emptying an ash tray on the customer's carpet. Don't pollute my screen with any more windows, thanks (particularly since current operating systems have miserable window management). If I want a new window, I will open it myself!

6
  • 1
    Tell that to people that made Google Reader and Gmail.
    – Andrija
    Aug 20, 2009 at 21:04
  • 6
    @Andrija: Those are applications. They may live in the browser, but they are still applications. Applications may have a reason to open new windows, though it should be immediately obvious to the user that that is what will happen (don't make me think!). A webpage that opens a new window or tab without my explicit request is broken, and I won't stand for it. Aug 20, 2009 at 21:28
  • 15
    @dmckee I see SO sites as an applications, I expect external links to open in external window/tab, so I can switch between them for info, without thinking of it :) I want my SO sites ALWAYS open in one window, where ever I click
    – Andrija
    Aug 20, 2009 at 22:05
  • @dmckee again, this should be only an option, and by default it should open in existing window of course since it already works that way
    – Andrija
    Aug 20, 2009 at 22:07
  • 9
    I disagree, in this era where no browser opens a new window (just a new tab) Nielsen's comment is a bit dated Jun 1, 2011 at 2:49
  • How are you going to get that control from "Ask Question" Page when clicking on the similar question in search list? :)
    – nawfal
    Jul 30, 2012 at 2:16
35

It could be an option in the preferences, like it is on reddit.

2
  • 11
    even google search preferences have this option - very handy that you don't have to concentrate
    – Antony
    Jul 4, 2009 at 7:45
  • This is what means "give a choice" in this case I do believe. How many times one should go back and scroll to the point they were reading or re-submitting requests... just because almost everywhere else new tabs open but here.
    – Artfaith
    Jul 28, 2023 at 16:37
23

Someone made a user script.

And it works =)


To install and use that userscript, follow these steps:

  1. Install userscript extension for your browser from Tampermonkey website.

  2. Once installed, open Tampermonkey context menu > Create a new script.

  3. Paste in the JavaScript code that follows.

FYI:

  • script is up to date May 2019, and works fine in Firefox 67;

  • feel free to @include additional URLs at your convenience.

// ==UserScript==
// @name           Open in new tab any link on StackOverflow or other StackExchange
// @namespace      http://userscripts.org/users/4294
// @description    Makes non-internal SOFU links open in a new tab or window
// @include        https://stackoverflow.com/*
// @include        https://serverfault.com/*
// @include        https://superuser.com/*
// @include        https://meta.stackexchange.com/*
// @include        https://askubuntu.com/*
// ==/UserScript==

(function() {
  'use strict';

  var allLinks, thisLink;

  var remoteP = new RegExp("^https?://");

  allLinks = document.evaluate('//a[@href]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

  for (var i = 0; i < allLinks.snapshotLength; i++) {
      thisLink = allLinks.snapshotItem(i);
      if (remoteP.test(thisLink.getAttribute("href"))) {
          thisLink.target="_blank";
      }
  }
})();
  1. File > Save.

  2. In Tampermonkey dashboard, make sure the script is enabled.

  3. No need to restart the browser, just refresh open tabs, and you're ready to go.

7
  • 2
    Wow, thanks for sharing! I'm definitely checking this one out.
    – Nathan
    Aug 10, 2011 at 5:12
  • +1 for this find ! It does make sense to make links in answers automatically open in new tab. Sometimes a user might put more than one reference link.
    – GoodSp33d
    Nov 23, 2012 at 9:07
  • 2
    broken link, won't work in this window or a new window lol
    – toddmo
    Oct 28, 2015 at 23:52
  • 1
    Please fix the broken link - or consider deleting this answer.
    – Matt
    Dec 4, 2017 at 14:26
  • 1
    I wrote my own Tampermonkey userscript StackExchange link newtaber and it works on any StackExchange site. you could install it from my git repo. Mar 7, 2018 at 16:19
  • 1
    I put my script on stackapps. you could get it here Mar 7, 2018 at 18:29
  • Purely marvelous! Thank you very much! Just in case, "SOFU" - Stack Overflow, Server Fault, Super User.
    – Artfaith
    Jul 28, 2023 at 16:42
16

There are more ways to open a link in a new window if it does not by default (Ctrl click, middle mouse click (in some browsers)) than there are ways not to open a new window when a link does by default.

So my feeling is no on this.

13

I don't know if it's a problem but I personally think it's better to open a link in a new tab so you can just answer/view the question you were visiting before clicking the link.

It's a problem when you want to just navigate from one page to another. Personally I do not want my browser spawning 200 tabs in a single browsing session just by question/answer-hopping (and trust me, that's how far back my browsing history goes on SE in an average session).

Most people spend more time just browsing than answering questions. Forcing links to open in new tabs always is a recipe for disaster.

2
  • 5
    Also, I consider opening another window or tab intrusive. It's like "dude, we knew better then you that you wanted that in a new window!"...it's just as annoying as sound in ads (I'm looking at you imgur). Jun 5, 2013 at 14:17
  • For some reason, it feels more convenient to close a new tab (e.g. Ctrl+W) and return to exactly where you were prior opening, and nothing seems lost, and nothing seems require to be re-downloaded again... What if the Internet connection got lost just before clicking? For some reason... it feels more appropriate to not discard information into void by default...
    – Artfaith
    Jul 28, 2023 at 16:47
10

IMO, this is something that should only be handled by your browser. It really annoys me when a website decides it wants to do funky things with its links. If I want a new tab, I will middle-click.

If you don't want to bother [middle/Ctrl/Shift] clicking, I'm sure you (or someone else) could easily code up a Greasemonkey script for this.

9

I was about to post a new question, then found this one.

I agree that not all external links should open in a new window as that's just annoying & I know how to do it if I want to.

However, it would be a nice touch if any links to jsFiddle.net and similar sites were automatically rendered with target="_blank", because I am forever clicking through to one, tinkering, and then having to abandon it to refer back to the question.

Especially annoying when the link is 'disguised', such as "I've got an example here".

3
  • How is "example here" a 'disguised' link? "example here" is a much better link text than the (unfortunately very common) "here" or "this link". Jun 5, 2013 at 14:15
  • 1
    jsfiddle links.... exactly why i searched for this feature suggestion.
    – d-_-b
    Jul 17, 2013 at 2:54
  • 1
    Yes, we have the same problem on dba.se with sqlfiddle links.
    – Aaron Bertrand Staff
    Sep 14, 2015 at 17:47
9

This would hinder people from using their browsers in the normal way. Target _blank makes sense when following a link would be interrupting the user's work and cause possible data loss. Otherwise, it should be left up to the user where to open the page, and the default should always do so in the current window as that is the browser default, most expected behavior, and the only option that cannot be easily achieved other ways.

This functionality is already in your control. Try:

  • Ctrl-Click the the link
  • Rick clicking the link and asking to open in a new tab
  • Middle clicking on some systems
  • Keeping a sidebar or separate window open for following references and drag the links you want to open over to it.
1
  • "it should be left up to the user to do". I like that word, i understand now :D
    – GusDeCooL
    Jun 29, 2013 at 15:55
8

I've noticed on Stack Overflow that if you're following two or three trains of tought, it is almost always better for the links to open in a new window. I think it should be available as a link configuration option.

2
  • 3
    Or you could just open the new windows yourself with a simple middle-button or control click and save the site one more configuration option. :D Jan 22, 2011 at 16:30
  • 1
    @GordonGustafson, or the site could code it one (1) time and save 1000s of developers from having to think and do that millions of times. Either way. Whatever saves the most time overall.
    – toddmo
    Oct 28, 2015 at 23:54
6

I love Google Reader that has this by default. It would be great to have it at least as an option. Using keyboard to open to external link means I have to move my other hand to keyboard, this is usually not a problem for me, but sometimes it is, if I hold coffee in my other hand it could be a productivity problem :) , this way I could use only mouse!

2
  • 2
    You could also try middle-click. Aug 20, 2009 at 20:17
  • I hate middle click, never use it. Finger slips forward, on some mouses you have to press harder to click it, while you trying to click it it goes up and down...hate it.
    – Andrija
    Aug 20, 2009 at 20:59
6

This is the one thing on SO that time and again screws me up. I expect external links to open in new tabs and I am constantly closing an external page when I'm done looking at it, only to find that my previous session on SO has disappeared along with it. It's frustrating because it doesn't make sense to me for an external link to open overtop of the site you're viewing.

But I suppose people have different tab-using habits, and I treat a new tab like a new session--a branch in my exploration of a thought. When I want (or more importantly for this discussion expect) the session to branch (after all I don't necessarily check where a link is going before I click it), I mentally treat that external link as a new session that I can kill if I'm through with it. It's a strange feeling to have StackOverflow hide underneath that session and disappear when I kill it.

I don't buy the argument "let me control my browser: if I want a new tab I'll do it myself", primarily because a) tabs are cheap, I want to be able to close a tab and not worry about it getting rid of some unrelated previous session, and b) this just means extra mental effort to decide in advance whether I want to consider an action a branch in my exploration or part of the same thought.

3
  • 1
    I don't agree with this, but +1 anyways for the detailed answer.
    – Pops
    Aug 12, 2010 at 20:03
  • If you think tabs are cheap, you've never been the victim of sites that spawn willy-nilly and leave you with 200 tabs at the end of the day, three of which you want to keep. May 19, 2016 at 14:43
  • Oh I have. Yeah obviously it can be overdone. If it's done to force the visitor to have umpteen different copies of your site open in their browser (like a lot of those clickbait sites) that's obviously not a good reason.
    – devios1
    May 19, 2016 at 19:01
5

I would say very heartily YES, especially if it is a link to an external site. The standard convention is, if it's a link to yourself, no popup/new window, but a link to an external site should be in a new window/tab.

4
  • 9
    The standard convention as established by... ? Aug 20, 2009 at 20:15
  • 10
    No. NO. NO! Don't make me look to see where the link points to understand how it will behave! I want to be in control of my browser. When I want a new tab, I'll issue that command. Aug 20, 2009 at 20:52
  • 1
    Established by nobody I want establishing standard conventions for me, anyway. Aug 20, 2009 at 20:53
  • 4
    I agree with this. New tab/window for an external site. Much easier to close a new tab rather than click back through history to get to where I was originally.
    – churnd
    Aug 24, 2009 at 12:26
5

That's a bad idea, what if you want to navigate to another page in the same tab/window?

Press Ctrl when you click on the link. In most browsers, that causes the tab to open in a new tab. Or click with the scrollwheel of your mouse. At least for me, it causes links to be opened in a new tab.

2
  • yeah i know about ctrl+click, but i don't think everybody know this. And sometime some people forget to hold ctrl.
    – GusDeCooL
    Jun 29, 2013 at 15:50
  • What i mean is only add link target blank inside question frame. not in all navigation e.g. header navigation.
    – GusDeCooL
    Jun 29, 2013 at 15:51
4

It would be great if we could have an option on our account to have links posted in answers and questions to open in new windows.

This would be a pretty awesome feature to have, as it is kind of difficult sometimes to have to keep using the middle scroll thing on my mouse to click on links — I rather just click them normally and have them pop up without holding keys down.

4
  • 1
    We try really hard to be different from online forums, so arguing that most forums do something is not a particularly compelling way to get a feature implemented. ;-) Aug 10, 2011 at 5:23
  • @Cody Sorry about that. I wont say anything about other forums again.
    – Nathan
    Aug 10, 2011 at 5:46
  • 1
    No worries. Thing is, I'm pretty against sites which purport to control how I want to browse. If I want things to open in a new window, I should have to explicitly request that myself, either by clicking the middle button or using the Ctrl key in conjunction with my click. What if I don't want pages to open in a new window/tab? Aug 10, 2011 at 5:51
  • 1
    If you don't want pages to open in a new window/tab you would simply turn that off somewhere if this were available. But I guess I can just use the middle scroll to click links or right-click and open in a new tab.
    – Nathan
    Aug 10, 2011 at 5:54
4

TL;DR;
Technology is supposed to be there to serve us, to make life easier. Automated things can most certainly make life easier, but they don't when whatever is being automated is for something which has multiple options which have no fixed or set logical outcome each time - i.e. user preference.



More indepth to cover some of the points raised here in the answers/comments, and in some of the duplicated questions.

Our choice of new tab or not changes based on scenario, from from one link to another, from one day to the next.
Our decision changes towards whether to new tab or not new tab, and the function (or the programmers of it) don't know which outcome each individual user wants to occur, so it cannot be automated.

I sometimes open linked questions in a new tab if (eg) I'm learning something complex and want to refer back to a previous answer (etc). And sometimes it wasn't the answer I wanted and so don't want to open a new tab with the linked answer.
This extends to many other scenarios with various different link types, where I change my desired outcome, and surely you (reading this) are the same?

In fact, I can sometimes want a different outcome for the same link on different days, depending on what I'm doing that day.

We have various "simple built in and default" options to open a link in new tab (which I sometimes do), however we do not have various "simple built in and default" options to not open in new tab.

Open in new tab by:

  • Ctrl left click
  • Middle mouse button (as standard or can be set)
  • Right click choose "open in new tab"

Not open in a new tab by:

  • Fiddle with my browser config
  • Install an add-on
  • User script
  • Probably some other "in depth" options which potentially affect other scripts or cause unforseen problems as it's not "built in/standard" functionality

We can open a new tab currently with a few choices of built in options, however not opening new tabs we do not without scripts or addons etc. By implementing automated new tabs, we force users to have to use scripts and configs to stop them, whereas currently no-one has to do that and essentially everyone is catered for.

The website cannot please everyone, and so the least problematic outcome is catering for those with the least control - those who cannot stop a new tab easily.


Only some links

It does not matter what links this is for - external, internal, profiles, JSFiddle, etc. In fact, mixing which links do and don't automatically open in a new tab is the problem with the internet and websites.

Some sites open new tabs, some don't, and some even only open new tabs on some of their links.

This is like eating a bag of revels blindfolded.

We just do not know when a link will open a new tab, or when it will not = we have no control as over the internet as a whole it's entirely erratic.

Some people are voting and suggesting for only certain links to be opened in a new tab, eg JSFiddle, or user profiles. So user group A knows that links to "JSFiddle on Stack Exchange sites" open in a new tab. Well, jolly wonderfulness for them users. What about everyone else who doesn't?

What if user group A gets their wish, and user group B wants another "specific" type of link to open in a new tab? user group A then clicks that link and unexpectedly goes to a new tab.

Do we change it back because user group A didn't want that?
Do we change the JSFiddle links to not open in a new tab because user group B doesn't want that?

Who are we serving here? Who gets their own way? Why are we even fighting when the simple solution is that all links (ideally on all websites, but yeah) do the same thing! Then we know what will happen each and every time, and can plan and use our own personal methods and desired outcomes each and every time.


Internet a better place

If the entire internet "did not" open new tabs automatically, then we could flow through our usage of websites with ease, with predictability and using our own personal methods.
If we want to leave the page then simple click the link, if we want to keep the page and see the linked one as well, open in new tab - this is using technology to our advantage.

Automated new tabs sucks more than a half starved anteater finding a previously undiscovered ant colony.

Automated new tabs are just not logical captain.

3

This is a design feature which has been ruined by "bad" design; we're so used to that clicking a link gets us a new tab that we're not capable of immediately understanding why SE's way is so great;

  1. It leaves you in control
  2. It reduces the amounts of needless tabs
  3. You get a nice flow in where you're going following the links

What we need to remember is that the system of opening new tabs in a lot of browsers is often that the new tab comes after the other tabs opened from the same page, which is a bit messy if you have opened several links as new tabs and then you want to use the existing window to move on to the next step in the link-flow.

It may take you a while to unlearn the expectation of a new tab/window, but when you get used to it, it's really great.

With this feature, you have the power over the links.

2

Arrow

An arrow on top-right, showing that a certain link will open in a new tab. Like so:

arrow


Pop-up Message

Taking it even further, include a pop-up that shows upon hovering on such a link: "Keep single tab".

Example (hover over me)


Preferences

Learning from Android, have a choice when taking an action: "Always - Just once".

always-once


More Preferences

Add this to Settings so every user can choose the default behavior.

settings can change

You must log in to answer this question.

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