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.

  • @[email protected]
    link
    fedilink
    English
    701 year ago

    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.

    • @[email protected]
      link
      fedilink
      381 year ago

      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.

      • @[email protected]
        link
        fedilink
        31 year ago

        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.

    • @[email protected]
      link
      fedilink
      English
      241 year ago

      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.

    • @[email protected]
      link
      fedilink
      11 year ago

      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.

    • @[email protected]
      link
      fedilink
      141 year ago

      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.

    • @[email protected]
      link
      fedilink
      41 year ago

      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.

    • @[email protected]
      link
      fedilink
      -191 year ago

      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.

      • @[email protected]
        link
        fedilink
        181 year ago

        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.

          • @[email protected]
            link
            fedilink
            21 year ago

            “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.

            • @[email protected]
              link
              fedilink
              -21 year ago

              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.

              • @[email protected]
                link
                fedilink
                61 year ago

                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
      • Deebster
        link
        fedilink
        121 year ago

        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.

        • @[email protected]
          link
          fedilink
          -31 year ago

          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.

      • @[email protected]
        link
        fedilink
        81 year ago

        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?

      • @[email protected]
        link
        fedilink
        English
        7
        edit-2
        1 year ago

        Everyone knows the various workarounds.

        You have no idea what “everyone” knows. Many - and I’m certain most - don’t.

        • @[email protected]
          link
          fedilink
          01 year ago

          Mine doesn’t but I’ve found an option to switch three-finger click to middle mouse button. Thanks.

      • @[email protected]
        link
        fedilink
        5
        edit-2
        1 year ago

        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.

      • Natanael
        link
        fedilink
        41 year ago

        Most laptops have gestures like triple finger tap on the mouse pad for simulated wheel click

        • @[email protected]
          link
          fedilink
          0
          edit-2
          1 year ago

          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.

          • @[email protected]
            link
            fedilink
            1
            edit-2
            1 year ago

            “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.

    • @[email protected]
      link
      fedilink
      21 year ago

      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.

      • @[email protected]
        link
        fedilink
        English
        41 year ago

        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.

    • @[email protected]
      link
      fedilink
      01 year ago

      That they are allowed/capable to, is beyound me. That starts with font size and ends with viewport-width.

  • Zloubida
    link
    fedilink
    English
    321 year ago

    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.

    • @[email protected]
      link
      fedilink
      81 year ago

      Yeah, this is the real reason you’re not supposed to open external links in a new tab. It’s an accessibility issue.

  • @OptimusPrimeA
    link
    301 year ago

    If you can, contribute to the code. You can do a pull request if you want.

    • Otter
      link
      fedilink
      English
      32
      edit-2
      1 year ago

      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

      • Fonzie!
        link
        fedilink
        01 year ago

        No, because it’s not a bug.

        Please don’t clutter actual bug reports with feature requests or design discussions.

    • Dem Bosain
      link
      fedilink
      English
      61 year ago

      How do I get all links on a specific website to open a new tab?

    • @[email protected]
      link
      fedilink
      31 year ago

      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.

  • @[email protected]
    link
    fedilink
    English
    171 year ago

    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.

    • @[email protected]
      link
      fedilink
      English
      91 year ago

      Middle click (or command-click on Mac) will also open in a new tab in basically every browser.

      • Flying Squid
        link
        fedilink
        1
        edit-2
        1 year ago

        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.

        • Fonzie!
          link
          fedilink
          11 year ago

          Most mice have a middle click, it’s pushing down the scroll wheel, this works on Windows, macOS and (most) Linuxes alike.

  • @[email protected]
    link
    fedilink
    English
    151 year ago

    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.

  • @[email protected]
    link
    fedilink
    21 year ago

    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.

  • Dem Bosain
    link
    fedilink
    English
    2
    edit-2
    1 year ago

    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.