News for hackers. Stuff that matters.
Re:Ask HN: Why doesn't HN open news to a new window? by necovek on Saturday June 10, 2023 @01:31AM (#36267898)
No browser has an "open in this window despite what the target attribute says" click, so in that sense, it's for the better (user should be in control).

The alternative (middle click or whatever multiple-finger tap to open in a new tab) is usually available.

Re:Ask HN: Why doesn't HN open news to a new window? by bombcar on Saturday June 10, 2023 @01:24AM (#36267863)
Most people know about middle click or right click - new window.
Re:Ask HN: Why doesn't HN open news to a new window? by gregjor on Saturday June 10, 2023 @04:03AM (#36268636)
> Why doesn't HN open news to a new window?

Because the links don't have '<a ... target="_blank">' in them.

> Was that a design choice?

That's the default for links. You have to explicitly add the target attribute to tell the browser to open a new tab or window. Someone decided on this behavior (the default behavior), so I guess you can call it a "design choice."

> Why would they choose that?

Because browsers let you open links in new tabs/windows if you want (right click, middle click, ctrl-click), but they don't let you prevent the new tab/window if the <a> element has the "target" attribute. In lieu of compelling reasons to the contrary, it's best to let users control their browser.

Maybe the HN programmers also wanted to cut down on the "I have too many tabs open, I need some way to manage them" posts by not contributing to that problem.

Re:Ask HN: Why doesn't HN open news to a new window? by xigoi on Saturday June 10, 2023 @07:27AM (#36269597)
> they don't let you prevent the new tab/window if the <a> element has the "target" attribute.

Don't browsers have an “open in current tab” option?

Re:Ask HN: Why doesn't HN open news to a new window? by prepend on Saturday June 10, 2023 @06:13PM (#36275726)
No.
Re:Ask HN: Why doesn't HN open news to a new window? by krm01 on Saturday June 10, 2023 @07:54AM (#36269731)
At least you noe have a option with keyboard shortcuts to open in a new tab if you choose to do so. If you don’t want that, you can open it in the same tab.

Better UX IMHO

Re:Ask HN: Why doesn't HN open news to a new window? by mejutoco on Saturday June 10, 2023 @12:07PM (#36271714)
You can control click or middle click on a link.

Most websites only open external links on a new window/tab because they don‘t want you to leave to monetize you further. Maybe hn does not care as much, which is good IMO.

Re:Ask HN: Why doesn't HN open news to a new window? by jakabia on Saturday June 10, 2023 @05:17PM (#36275205)
To be honest, I'm on the edge to write a Firefox extension just to solve this problem. I'm using a Macbook with a touchpad, and sometimes it's just inconvenient that I can't just click on it.
Re:Ask HN: Why doesn't HN open news to a new window? by electroagenda on Saturday June 10, 2023 @07:32PM (#36276426)
I think that question is more complicated to reply than it looks like.

From the point of view of HN, it should be better to open in new window. That avoids users going out of your page.

However, as a blogger I have discovered the technical audience annoys enormously when links open in a new window. People get angry because you always have the shortcut to choose the new window if you indeed desire that.

So, to me, HN has decided to please its audience at the cost of loosing pageviews.

Re:Ask HN: Why doesn't HN open news to a new window? by akiranews on Sunday June 11, 2023 @03:53AM (#36279225)
Good comments from everyone. For anyone else stumbling to this thread I want to add that at least on iPhone's Safari it's more cumbersome to open to a new window than it is on a desktop browser with middle click or ctrl click.
Re:Ask HN: Why doesn't HN open news to a new window? by gnicholas on Sunday June 11, 2023 @03:16PM (#36284622)
There are HN-optimizing browser plugins that include this as a functionality.