Description

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. Currently only works for community/user links.

Home Instance Setup

Simply visit the Lemmy instance you want to set as your home while the script is active. You will be asked if you want to set this instance to your home instance:
home

If you initially set your home instance wrong or just want to change it, no worries - simply go to your settings on your new home instance and press the button for it!
settings

Features

  • Rewrite all links of communities or users on all websites everywhere to your new instance! The rewritten links will have an icon next to it, and hovering/touching the icon will show you the original link, allowing you to go there if you want to.
    rewrite

  • If you are already on a page that has a corresponding page on your home instance, a link will automatically be added to the page header.
    redirect

Coming soon

  • Post & comment links. Those are a bit harder because the URL has to be requested from the instances.

Repository & Issues

  • Zamboniman
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 years ago

    Got the ‘home instance’ dialog this time. Briefly checked it out, some of the links seem to be now directed towards my home instance, but there are no icons beside any link to show the original link as indicated in the description above.

    Edit: Noticed the following error in the console:

    Source map error: Error: URL constructor: tippy-bundle.umd.min.js.map is not a valid URL. Resource URL: user-script:http%3A//azzurite.tv//Lemmy%20-%20Rewrite%20Links%20to%20Home%20Instance Source Map URL: tippy-bundle.umd.min.js.map

    • Azzu@feddit.deOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      2 years ago

      That error’s irrelevant. Can you check that you have version 1.0.2 not 1.0.1?

      • Zamboniman
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 years ago

        I have 1.0.1. An attempted update shows ‘No newer update available.’

          • Zamboniman
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 years ago

            Got it. Upgraded to 1.0.2.

            Still no icons to the right of links.

            • Azzu@feddit.deOP
              link
              fedilink
              English
              arrow-up
              2
              ·
              2 years ago

              Maybe try violentmonkey instead of greasemonkey, which does not seem to be in development anymore.

              • Zamboniman
                link
                fedilink
                English
                arrow-up
                1
                ·
                edit-2
                2 years ago

                …and I spoke too soon. Worked fine when I installed it. As soon as I went to another page on the instance it stopped working again. No icons, no button in settings. No idea what’s going on.

                • Azzu@feddit.deOP
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  2 years ago

                  Does it work again when you do a full refresh? So F5/press enter in the adress bar? If so then somehow listening to page changes is broken for you, lemmy doesn’t actually load new pages when you click on an (instance-local) link, it just exchanges all the content within the currently loaded page.

                  • Zamboniman
                    link
                    fedilink
                    English
                    arrow-up
                    1
                    ·
                    2 years ago

                    Does it work again when you do a full refresh? So F5/press enter in the adress bar?

                    It does not. I’ve tried that several times. Also tried opening a new tab and typing the site url directly.

              • Zamboniman
                link
                fedilink
                English
                arrow-up
                1
                ·
                2 years ago

                Yeah, that’s not a bad idea. I think I’ll give that a try a bit later when I get some time, as I’ll have several scripts I’ll need to move over to it.

              • Zamboniman
                link
                fedilink
                English
                arrow-up
                1
                ·
                edit-2
                2 years ago

                Gave violentmonkey a try. Your script worked perfectly immediately. So yeah, something in greasemonkey was causing the issues.

                Thanks for writing this, looks great so far!!

            • Azzu@feddit.deOP
              link
              fedilink
              English
              arrow-up
              1
              ·
              2 years ago

              Yeah no idea, you can change DEBUG from true to false and see if it’s outputting any messages at all. I’d probably need to do some more advanced debugging steps, idk if you’re willing to do that

      • Zamboniman
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 years ago

        Ah, yes. It’s 1.0.1. Let me upgrade once again.