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.
I prefer the current behaviour.
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.
Ctrl+click also works
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.
Just hit ctrl+w after clicking the link. That will close the current tab.
You can use middle click to open sites in a different tab
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.
Laptops don’t have middle clicks.
Everyone knows the various workarounds. You don’t need to post them. This thread is about a problem that ought not to exist.
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.
A simple checkbox in the settings allows users to choose which option they’d prefer.
“just add a setting” is generally bad software design. If you have a million toggle switches, it makes it difficult to test the various combinations.
Sometimes an option is useful enough that it’s worth adding to settings. I don’t think this is one of them. Just use middle click or Ctrl+click or back arrow.
It’s overriding my browser preferences. That should not happen.
[This comment has been deleted by an automated system]
I found a bunch in Firefox config settings. One was so extreme that on Kbin, refreshing the feed would open a new tab. In Lemmy, nope, didn’t work.
Calling BS on that. There is nothing in lemmy’s link that would force opening in the same tab. Proof:
- there is nothing preventing middle-click/shift-click/context menu from actually working as intended
- there is nothing on the
a
elements related to that, anyone can see it on every page
[This comment has been deleted by an automated system]
I think that forcing links to create new tabs world be a problem. Links working the default, normal way is a feature, not a bug.
Links opening in new tabs is the default normal way. Most sites don’t send you off their site by default, for obvious reasons. And most feeds won’t lose your place in the feed by default, for equally obvious reasons.
Please tell me how to open a link with
target=_blank
in the same tab if I want to.Or, maybe you think that the problem should not exist because you think your opinion is everyone’s?
Everyone knows the various workarounds.
You have no idea what “everyone” knows. Many - and I’m certain most - don’t.
My laptop has middle click on the touchpad
Mine doesn’t but I’ve found an option to switch three-finger click to middle mouse button. Thanks.
Ctrl + Click
But yeah, it’s odd.
The worst is fucking Jira. Why on Earth would I want to navigate away from my ticketing system EVER.
Most laptops have gestures like triple finger tap on the mouse pad for simulated wheel click
They do when you plug in a mouse.
So now I need to buy a mouse and sit at a desk in order to use Lemmy?
C’mon. No other site behaves like this. It needs to be fixed.
“To own a mouse, one must first buy a mouse.”
- Carl Sagan
Once you’ve crawled under that hurdle, you buy a hard mouse pad. Mine’s steel covered with a thin layer of plastic. Works great on the arm of a couch or just on a pillow.
Now you can play first person shooters on the couch! Without the horrors of a controller.
Navigating the web is easier. Everything is easier! It’s dreamy. Give it a try sometime.
If I wanted a mouse, I would have a mouse. I do not want a mouse.
This thread is about a problem that ought not to exist.
Exactly
Web apps should not override the configured behavior of browsers.
It does not. There is nothing on lemmy’s link to force link to open in the same tab. Your browser can do whatever it wants.
Maybe your confusing the behavior that a lot of site decided to implement as default (open in new tab) with a browser setting.
Maybe your confusing the behavior that a lot of site decided to implement as default (open in new tab) with a browser setting.
Try reading OP’s title and post body, then my reply again.
Dang I was so angry at people claiming the opposite it kinda blinded me into thinking you meant it the other way around. Sorry.
lol, no worries.
That they are allowed/capable to, is beyound me. That starts with font size and ends with viewport-width.
deleted by creator
Yeah, but no: blind and visually impaired people have troubles navigating the web because of these links that are opened in a new tab/window.
It could be an option to activate, though.
Yeah, this is the real reason you’re not supposed to open external links in a new tab. It’s an accessibility issue.
deleted by creator
How do I get all links on a specific website to open a new tab?
easiest way is to middle click them
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.
Lemmy overrides that setting. It works everywhere but here and it is irritating as hell.
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.
Alexandrite opens external links in new tabs.
It also has a light mode now. I know that was a drawback for some folks when it was first being mentioned.
deleted by creator
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 (or command-click on Mac) will also open in a new tab in basically every browser.
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.
Most mice have a middle click, it's pushing down the scroll wheel, this works on Windows, macOS and (most) Linuxes alike.
If you can, contribute to the code. You can do a pull request if you want.
There might even be discussions on it which you can vote on.
Eventually it would be nice to have a toggle in the settings. Could keep the current behavior as the default and let users change it
At the very least, file a bug report 👍
No, because it's not a bug.
Please don't clutter actual bug reports with feature requests or design discussions.
There’s browser addons in the meantime. !plugins@sh.itjust.works
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.
I wrote a userscript for old.lemmy.world to make the header floaty and to force links into a new tab.
It’s not completely perfect, but it’s increased my QOL and I’d hate to go back.
It won’t work on the default site, of course.
Let me know if you want it, it’s short enough to just paste in a reply.
deleted by creator
You could submit a PR to change it?