Lemmy External Instance Link Following Behavior

https://lemmy.world/post/73963

Lemmy External Instance Link Following Behavior - Lemmy.world

Right now, when I follow a link posted on this instance to another instance, it takes me to that instance. I’m aware that this is Mastodon’s behavior, and I find it repulsive there too, but it’s even worse on a Reddit equivalent. Currently, to actually get subscribed to a sub, I have to either go to the actual instance and copy the link, or copy it manually here, travel back to this instance, pull open the search bar, post it in, search for it, wait for the search, and finally it’ll let me click on a button to take me to a page on this instance where I can subscribe to it from this instance. Please. For the love of my poor mobile fingers. Make instance links skip most of that and just go straight to the local subscribe page?

Take a look at this greasemonkey script
Tampermonkey/Greasemonkey script to redirect to your local instance - Lemmy.world

For those that use Tampermonkey or GreaseMonkey, here’s a quick script I whipped up that creates a button that redirects communities from other instances to your local instance. If your instance isn’t lemmy.world, then change the localLemmy var at the top. Enjoy! js // ==UserScript== // @name Lemmings Fix // @version 1.0 // @description Redirect to your local Lemmy instance // @author @lemmy.world/u/soy // @match https://*/c/* // @icon https://join-lemmy.org/static/assets/icons/favicon.svg // @grant GM_addStyle // ==/UserScript== const localLemmy = 'lemmy.world'; var isLemmy = document.head.querySelector("[name~=Description][content]").content === 'Lemmy'; if (isLemmy) { // Get URL info var splitUrl = location.href.split('/'); var instanceUrl = splitUrl[2]; var community = splitUrl[4]; var localizedUrl = 'https://' + localLemmy + '/c/' + community + '@' + instanceUrl; // Create redirect button if not on local if (instanceUrl !== localLemmy) { var zNode = document.createElement ('div'); zNode.innerHTML = '<button id="localize" type="button">Open in local instance</button>'; zNode.setAttribute('id', 'localizeContainer'); document.body.appendChild(zNode); document.getElementById ("localize").addEventListener ( "click", onLocalize ); } } function onLocalize (zEvent) { window.location.replace(localizedUrl); } GM_addStyle ( ` #localizeContainer { position: fixed; right: 0px; bottom: 0px; } #localize { cursor: pointer; padding: 16px; } ` );