Very simple, from the source:

Lemmy Universal Link Switcher, or LULs for short, scans all links on all websites, and if any link points to a Lemmy instance that is not your main/home instance, it rewrites the link so that it instead points to your main instance.

In essence, any Lemmy link you come across is automatically redirected to your home instance. It’s also easy to customise, you can add/remove instances and prevent it from working on particular sites (or force it to only work on sites you wish).

Can be installed with Tampermonkey or ViolentMonkey (or similar tools).

note: this may also work just fine on mobile browsers that support extensions (and would likely help direct your browser to opening your lemmy app - if you have one - more often), but I haven’t tested this.

  • deranger@sh.itjust.works
    link
    fedilink
    arrow-up
    36
    ·
    edit-2
    5 days ago

    Out of curiosity, how many browse on desktop?

    I’ve been using Lemmy since the API exodus and only ever substantially used wefwef/Voyager the whole time. Even on desktop I use the PWA for Voyager.

    It would be cool if something like this could also be incorporated into the apps because it sucks when someone puts a link that doesn’t correctly use your instance to see the post they’re sharing, instead opening a browser to display the post.

      • deranger@sh.itjust.works
        link
        fedilink
        arrow-up
        6
        ·
        5 days ago

        I assume just via the normal desktop site? I tried that back when I very first started with Lemmy but I quickly switched to using the Voyager web app just because I like the app features and especially the post layout. I might have to give the default web interface another shot as I only tried way back when I first switched over.

    • criitz@reddthat.com
      link
      fedilink
      arrow-up
      7
      ·
      5 days ago

      100% of the time I’m using an app, just like I did on reddit. Don’t even know what the desktop site looks like (jk)

      • MakingWork@lemmy.ca
        link
        fedilink
        arrow-up
        3
        arrow-down
        1
        ·
        5 days ago

        100% of the time I’m using an app, just like I did on reddit. Don’t even know what the desktop site looks like (no jk)

    • Dave@lemmy.nz
      link
      fedilink
      arrow-up
      4
      ·
      5 days ago

      I do a lot of browsing on desktop, especially when comments need a lot of research. I use mobile a lot as well.

    • NOT_RICK@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      5 days ago

      I’ll browse here and there in browser on my laptop but 90+% of the time I’m using voyager

    • Azzu@lemm.ee
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      4 days ago

      I use this on the Android Firefox browser :D didn’t like the apps at the time I made this, that’s why I made sure that it’s compatible with mobile Firefox as well.

    • edric@lemm.ee
      link
      fedilink
      arrow-up
      3
      ·
      5 days ago

      I’m on desktop 80% of the time and use Alexandrite for its 2-column layout.

    • priapus@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      2
      ·
      5 days ago

      I use Voyager on mobile most of the time, but still do a little browsing on my desktop using Photon.

    • AnActOfCreation@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      5 days ago

      It would be cool if something like this could also be incorporated into the apps

      What does Voyager do if you click on a link to another instance? Open in the browser?

      Thunder tries to resolve the link to your local instance and opens it directly in the app.

  • GissaMittJobb@lemmy.ml
    link
    fedilink
    arrow-up
    9
    arrow-down
    1
    ·
    4 days ago

    Seems like something that should be upstreamed. We’re not on Reddit anymore, the source code is open and contributions get accepted. The need for userscripts has been removed basically

    • ubergeek77@lemmy.ubergeek77.chat
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      4 days ago

      Just being open source is not enough to solve this problem. You would need a record of your “home instance” stored somewhere that all Lemmy instances would always have access to it. Ignoring the security implications of that, you still can’t use browser storage or cookies for that storage. In browsers, those storage mechanisms are restricted to the websites that stored them in the first place. Browser extensions have their own storage, so they don’t have this limitation.

      I can’t think of an architectural solution to this problem without a browser extension.

      The closest alternative that could be upstreamed is what Mastodon does, which is prompt the user to enter their home instance every time they try to interact with something while not logged in. An upstream solution can never be fully automatic like a browser extension, but this may be “close enough.”

  • Azzu@lemm.ee
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    4 days ago

    It does indeed work on Firefox mobile with tampermonkey. I should know, I implemented this and am using it that way mostly :D Don’t like many of the apps.

  • fmstrat@lemmy.nowsci.com
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 days ago

    This is a bad idea. Hear me out:

    You click on a link to lemmy.world to a post that has hundreds of comments. Instead, you get redirected to my.instance where this community is not federated. The post is immediately federated and loads, and you see the post on your home instance.

    But no comments. No future comments, nothing.

    A better method would be to have just “action” links go to your home instance. I.E. up vote, comment, save, etc.

  • /home/pineapplelover@lemm.ee
    link
    fedilink
    arrow-up
    4
    ·
    5 days ago

    I mean I use Eternity and links are fine. It all depends on how your client handles it I guess. When I share stuff on here with my friends I set them all to share using lemm.ee and not the original instance as well.

  • Dave@lemmy.nz
    link
    fedilink
    arrow-up
    4
    ·
    5 days ago

    There’s also Lemmy Instance Assistant. It has multiple features but my most used is that if you end up on another instance it adds a link to take you to that same post/community on your home instance.

    It hasn’t been updated in quite some time but the dev was active on Lemmy not too long ago and it continues to work fine for me.

    There’s a community here, links in the side bar: https://lemmy.ca/c/instance_assistant

  • seat6@lemmy.zip
    link
    fedilink
    arrow-up
    4
    arrow-down
    1
    ·
    5 days ago

    This is a dumb question; but what’s the benefit to redirecting links to the home instance?

    • Madbrad200@sh.itjust.worksOP
      link
      fedilink
      arrow-up
      9
      ·
      5 days ago

      I’m logged in on sh.itjust.works, I’m not logged in or have an account on lemmy.ml. If I want to interact with posts from lemmy.ml, I want to do so from my home instance of sh.itjust.works whre I’m logged in and have my main account.

      • /home/pineapplelover@lemm.ee
        link
        fedilink
        arrow-up
        6
        ·
        5 days ago

        Also, if nobody on your instance has ever visited that sub or instance, redirecting to your home will kind of make contact with them so it shows up for other people in your instance.

        Idk if I’m explaining correctly, but federation only works if you opened it on your instance, without it, you will never find that content.

      • seat6@lemmy.zip
        link
        fedilink
        arrow-up
        1
        ·
        4 days ago

        But for example I’m on Lemmy.zip; and this post is lemmy.world; yet I seem to be able to interact with it fine. Mariner I’m missing something; but I don’t see the issue

    • priapus@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      7
      ·
      5 days ago

      If the links are to another post, you’ll stay logged in so you can interact. Without this it opens on the other instance so you cant interact.

  • jagged_circle@feddit.nl
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    4 days ago

    I want the opposite. If I’m viewing a post on my instance, how the hell do I get the URL for the post on the instance where that community lives?!? Its really annoying having to do this manually for a dozen posts.