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:

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!

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.

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

Coming soon

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

Repository & Issues

0 points

This should be integrated into Lemmy itself as a feature.

permalink
report
reply
0 points

I don’t believe this would be possible without relying on a userscript or a centralised site.

permalink
report
parent
reply
0 points

Assuming you are logged in to the website, couldn’t the website just check to see where you’re logged in to? Seems like a cookie might be able to do that (if the user gave permission)?

permalink
report
parent
reply
0 points
*

The functionality in this script is indeed only possible as an addon or userscript. Browsers specifically spent a lot of work trying to make it impossible for one site to get any information about which other sites the user visited, and for good reason. Just imagine the phishing this would allow if it were possible.

That said, there could of course be an official lemmy browser addon/userscript for this functionality. But it definitely wouldn’t be baked into the sites themselves.

Because idk if you noticed, but this script actually rewrites all links everywhere, so for example even if you get a result to some lemmy instance on duckduckgo, the link on duckduckgo itself will already point to your instance. Please tell me how that would be possible without an addon/userscipt :D

permalink
report
parent
reply
0 points
*

Also works on Android on Firefox with TamperMonkey, that’s what I’m mainly using it on. Also only tested it on Firefox, no idea about Chrome or anything else.

permalink
report
reply
0 points
*

I installed it on Firefox with Greasemonkey. I don’t get the dialog asking if I want to set my instance to my home instance, and I have no button in my settings. So, at the moment, the script appears to be inoperative.

Edit: Tried a few more things. I visited several other instances, other than my home instance of lemmy.ca, and still don’t get any dialog about setting an instance to my home instance. Greasemonkey shows the script as enabled, but that’s it. I’m running Firefox 114.0.2 on Arch Linux.

Edit2: Attempted to post an issue at the referenced Gitlab page, but this page does not exist, and a search for this project was a dead end. I have disabled the script until/unless the authors provide more information as to what is going on.

Edit3: Found the Gitlab project. The provided URL on the Greasyfork page is incorrect. It should be https://gitlab.com/foundry-azzurite/lemmy-rewrite-links

I will leave an issue.

permalink
report
reply
0 points
*

Need to get a bit of feedback from you.

Any errors in the browser console (F12 by default)? So go to lemmy.ca, press F12, make sure the console is open, refresh, look for red error messages. If there are, copy them to me.

permalink
report
parent
reply
0 points

Yes. The following error appears:

Script error in [Greasemonkey script http://azzurite.tv//Lemmy - Rewrite Links to Home Instance; version 1.0.0]: ReferenceError: GM_getValue is not defined

permalink
report
parent
reply
0 points

What addon are you using for userscripts?

permalink
report
parent
reply
0 points

Went to bed after I posted this. Will take a look in a bit.

permalink
report
parent
reply
0 points

This works great for me on lemmy instances! However, it doesn’t seem to work on kbin.social (it is included in const INSTANCES_KBIN). Would be great if this was working on kbin instances too!

permalink
report
reply
0 points

That’s already known, see “Coming soon”.

permalink
report
parent
reply

Lemmy Plugins and Userscripts

!plugins@sh.itjust.works

Create post

A general repository for user scripts and plugins used to enhance the Lemmy browsing experience.

Post (or cross-post) your favorite Lemmy enhancements here!

General posting suggestions:

  • Preface the submission with the type of enhancement - ex: [UserScript].
  • Include a screenshot of the enhancement in use (where possible)
  • Indicate the requirements for use (eg, greasemonkey, stylus, etc.)

Thanks!

Community stats

  • 3

    Monthly active users

  • 13

    Posts

  • 53

    Comments