Solution for opening a magazine on a Lemmy/Kbin from a different instance (no extensions/addons needed)

Thibaultmol@kbin.social to Reddit Migration@kbin.social – 6 points –

I'm sure many of us have had the problem of getting a link to a Lemmy/Kbin instance that isn't your own. But you want to subscribe to a magazine.

I created this JS bookmarklet (well no, GPT4 made it. But I helped xd)

If you are on the magazine's feed, click the JS bookmarklet and you'll be taken to your Lemmy/Kbin instance with that feeds url.

Step 1: create the JS bookmarklet by creating a new bookmark manually. You can name it whatever, but make sure that the url field is this entire section:

javascript:(function(){let prefix='https://kbin.social/m/';let url=window.location.href;let parts=url.split('/');let finalPart=parts[parts.length-1];let host=parts[2];let newURL=prefix+finalPart+'@'+host;window.open(newURL,'_blank');})();

(Github Gist)

Step 2: modify the 'prefix' to be whatever it is that your instance puts in front of a federated magazine.

With Kbin this is usually the url of your instance /m

With Lemmy it's the same but with /c

Step 3: Profit. Now you can visit a magazine from a different instance, click on the js bookmarklet and it should open a new tab where you can see the magazine in your own instance. And easily upvote/downvote or subscribe to it.

1