Why does lemmy have it, so any link takes you off the page instead of opening in a new tab or window?
It is a simple line of code and the entire site does this or add target="_blank" to every hyperlink, and it will do the same thing.
It sucks that you have to right-click every link to open in a new tab or window and it is such a simple fix.
It's easy to open a link in a new tab without right clicking. You can middle click (Windows and Linux) or command+click (MacOS). However there's no easy way to force a browser to open a link in the current tab if the site wants to use a new tab.
What I hate is when you click on what’s supposed to be an image that you’d expect to expand, but instead it’s a link because the embed isn’t supported. Then when you hit back you lose your place because the page your on isn’t saved and you’ve lost your place trying to get back.
I made this user style to help fix that problem by outlining images, and also make it so when you click an image it expands over the page at full size up to the width of the screen.
Though it's not perfect. If the image is already black it's hard to tell. You could change the outline color to something less common, but that looks ugly. Changing the boundary radius would probably be the best, but it's already marked as !important so I don't think I can change it. I'm open to suggestions on improving that part.
I was almost beginning to think I was browsing the whole web wrong by middle-click-opening a bunch of tabs, then going through them all after I've seen all the interesting headlines.
Or Ctrl+Click to open in a new tab in the background, or Ctrl+Shift+Click to open in a new tab and switch to it. Regardless, I agree with OP that this should be the default.
I'm aware of this and do this but its annoying when it could just open a new link away from Lemmy because so much of being on a lemmy instance for some reason involves me keeping Lemmy in one tab so I stay logged in... because if I leave... then I have to sign back in again.
Thats subjective. Different people have different opinions on how this should work. Making the default open in the current tab still allows you to have the alternate behaviour with ctrl+click or middle-click. The reverse does not.
target=_blank overrides the default behavior. If you want it in a new tab you can always do that, but if you do not there is no way to open it in the current window. Your browser shouldn't do anything you don't expect it to do. If you want all links to open in a new tab, there's a setting for that in your browser.
I don't really agree with this, though. I'm all about control or what have you, but I don't feel that I'm in less control if I cannot leave Lemmy when clicking a link. I can't see any flow where this is expected behavior other than the principle of not setting a target.
I really don't mind doing right-click-new-tab. What I don't like is, when you click back it often doesn't take you back to where you were before. So, totally agree with the request as it would leave you at your place.
Middle click works on a Mac too if you have a pointing device with one. My Logitech trackball does, but you have to push down the scroll wheel, so I never think about it.
If you force tabs to open in a new tab/window, how do you open it in the same tab/window?
Ultimately, it is about user control and possibly accessibility.
Depending on your input device you can open a link in a new tab directly through
Middle mouse click
Ctrl + mouse click
Ctrl + Enter
The alternative or fallback is to use the context menu like you say.
Who says they should categorically and always open in new tabs though? In what contexts? On what kind of environment behavior does that depend? Does it assume a standard single open, auto focus, close, get back to the previous page? What makes a navigate back worse?
If you want a general, categorical solution for your preference, as long as Lemmy does not provide a setting for it, a simple browser addon could automatically adjust all links on a websites pages, or your browser may offer it.
I have a greasemonkey script that does this on instances that support the "old" theme. I'm having trouble getting it to work on the default theme because target="_blank" seems to work intermittently. Or I could be doing something wrong, I haven't looked into it too deeply.