One thing that’s a bit of a hassle with Mastodon is that you can’t immediately follow people on other instances.

You have to copy the username and search for it on the server that has your account.

To make this easier, I’ve created a little bookmarklet. Press it, and you’ll be taken to the same account as viewed from the masto host you are on.

GitHub Gist: https://gist.github.com/bramus/d8bce55dab1881cde18aa2169c66ac33

(Change the value of `MY_MASTO_HOST` in the code to your mastodon host –not URL– and you’re good to go)

Mastodon User Page Bookmarklet

Mastodon User Page Bookmarklet. GitHub Gist: instantly share code, notes, and snippets.

Gist

I did notice that sometimes it doesn’t work, and the search API on your own host gives back a 404.

The UI doesn’t handle this well and just keeps on showing the spinner.

In that case, you’ll still have to do the manual steps.

Don’t know what’s causing this. Maybe an overloaded server at the other end?

@bramus hm I don’t seem to have any difficulty finding or following people on other instances? I wonder if there’s some difference in server implementations (version or something idk how any of this works)

@drwpow It’s really weird. Had issues viewing 3 accounts from mastodon.social on my host, while others from that server worked fine.

Refreshing didn’t help either, DevTools kept showing a 404 getting returned from the endpoint.

Only after manually searching for those account, it found it.

This leaves me to assume that there’s a cache on the server that’s intervening.

A cache is fine, yet it shouldn’t store the result as “not found” in case the other server doesn’t respond in a timely manner.

@bramus oh yeah that makes a lot of sense. definitely a few bugs to work out over the next few months 😅
@drwpow @bramus Me either. The “find”/search function on both the apps and in the browser finds people easily from every instance. Have not had any troubles…

@SaschaFreud @drwpow that's not the problem that this bookmarklet/extension is solving.

What is does solve is viewing a profile on another instance and then hitting follow. It won't work as you must do that on the instance that hosts your account.

This tool solves this by rewriting the profile URL so that it is served from your account's instance, so you can immediately hit follow without needing to manually copy-paste-search usernames.

@bramus @drwpow Ok… again, I haven’t had any issues as-is, including seeing profiles—but not trying to take away from your work.
@drwpow @bramus Same, I just clicked on @bramus's profile (I'm on Fosstodon.org) and was able to hit "Follow" and it just...worked.
@bramus I noticed this too. I can look at my server logs and work it out I think.
@indiealexh Hopefully you can find some clues in the logs.

UPDATE: Now look what we have here … a Chrome Extension that does the job!

Review is still pending, so you can’t find it on the Chrome Web Store just yet. Maybe later today, or maybe tomorrow … no one really knows.

The source code is publicly available, so you can clone it and load it unpacked if you want: https://github.com/bramus/mastodon-view-profile

GitHub - bramus/mastodon-view-profile: View Mastodon profiles on your Mastodon instance

View Mastodon profiles on your Mastodon instance. Contribute to bramus/mastodon-view-profile development by creating an account on GitHub.

GitHub

@bramus great extension.
I hope someday that can be built in thanks to a "shared" session or so.
No idea how it would be possible.

For now, I will install the extension.

@bramus i'm getting a 404 if i click on the chrome store link to get the extension
@mmasnick As mentioned review is still pending. After approval - which is hopefully soon - the link will work :)
@bramus @mmasnick It's live now and working. I was able to install it.
@bramus awesome! This is / was my biggest mastodon irritation!

@bramus Hi! Great work! Just a favour, could you implement the what is mentioned in this blog [1] as well? The follow button click action may be idk, "overwritten" so it launches a small pop up window with a remote-follow dialog? I think that'll be a smooth experience too!

[1]: https://www.hughrundle.net/how-to-implement-remote-following-for-your-activitypub-project/

How to implement remote following for your ActivityPub project

Use the ostatus subcribe protocol with webfinger to allow users to follow from other services and vice-versa

@bramus https://github.com/mastodon/mastodon/issues/20533 is an issue to allow viewing of follower/following lists from your local instance, so you can interact with it using your identity. It fixes the feature gap the bookmarklet is a workaround for, so please consider upvoting it.
Allow web users to view remote posts/follower/following lists inline in the web application, and at all in the mobile application · Issue #20533 · mastodon/mastodon

Pitch Currently when you view a user profile from your local instance via the web application, you only see their follower/following that are visible to the local instance. A link is provided, "Bro...

GitHub
@bramus if you're on the mobile apps you can literally just paste in any username as long as it includes instance tld and hit follow. This is nice for desktop though.
@bramus @thomasreggi built a similar bookmarklet for this kind of thing as well.
https://indieweb.social/@thomasreggi/109369591846357657
It’s good to see these popping up, but highlights a bit of a need for more native and easy to use solution. Hope we get that at some point.
thomas 🌸 (@[email protected])

Just created a mastodon browser bookmarklet that makes it easier for you to redirect from other instances to your instance. all you have to do is replace "indieweb.social" with your instance, unless your on "indieweb.social" 😉 So if you're clicking and find a mastodon profile you want to follow, you click the bookmarklet and it will take you directly to their profile on your instance 🪄 https://codepen.io/reggi/full/mdKqgQx

Indieweb.Social
@ampersarnie @bramus there's another solution out there from @elizabeth that I replicated here https://mastodon-redirect.deno.dev/ some good links there, it involves using local storage to set and redirect people to their instances a tool by @jlarky uses it https://imverified.up.railway.app/techtwitter
@ampersarnie @bramus @elizabeth @jlarky currently there's two hacks to do this, 1️⃣ use the bookmarklet when you want to redirect, or 2️⃣ if you're building an app have people redirect to a shared local storage server, I suppose I could integrate the bookmarklet and this local storage solution so you don't have to set your instance in the bookmarklet code 🤔

@ampersarnie @jlarky @elizabeth @thomasreggi Nice!

One area where my bookmarklet differs from those other ones, is that mine does not rely on URL parsing and therefore plays nice with mastodon hosts that are served from a subdomain.

(In Mastodon config terms: LOCAL_DOMAIN vs WEB_DOMAIN – https://docs.joinmastodon.org/admin/config/#federation)

Configuring your environment - Mastodon documentation

Setting environment variables for your Mastodon installation.

@thomasreggi @ampersarnie @bramus @elizabeth @jlarky

great work going on here by everyone!

I was trying to get this to work with posts but I noticed that the post ID is different between instances so not easy to cross-references. Has anyone looked into this?

@ricvolpe can you explain the usecase a bit more? :-)
@jlarky I'd like to favourite a post I stumble upon when browsing another server instance on Web without having to search the post URL in my server instance
@ricvolpe interesting, I don't browse too far away from my home feed :)
@ricvolpe @jlarky i think you can search for the full post URL from your home instance and it will get resolved
@ricvolpe @thomasreggi @ampersarnie @elizabeth @jlarky Ah I see. You need to visit a profile page, not a post detail page. Will look into it …

@ricvolpe @thomasreggi @ampersarnie @elizabeth @jlarky PR to include this metatag on Mastodon statuses: https://github.com/mastodon/mastodon/pull/21423

Also working on a revision of the bookmarklet so that it falls back to extracting the info from elsewhere in case the meta tag isn’t present.

Add user profile OG tag on status page by bramus · Pull Request #21423 · mastodon/mastodon

This PR adds the profile:username opengraph tag to status pages, in addition to it already being shown on account profile pages. This allows for easier automation to detect which profile published ...

GitHub

@ricvolpe @thomasreggi @ampersarnie @elizabeth @jlarky Updated my bookmarklet to cater for more scenarios.

It now handles profile pages, profile pages that have moved to a different server, and status pages.

https://gist.github.com/bramus/d8bce55dab1881cde18aa2169c66ac33

Feedback welcome :)

Mastodon User Page Bookmarklet

Mastodon User Page Bookmarklet. GitHub Gist: instantly share code, notes, and snippets.

Gist

@bramus @thomasreggi @ampersarnie @elizabeth @jlarky

nice!

it seems to be working well for me except for profiles on front-end.social, not sure why!

@thomasreggi @ampersarnie @ricvolpe @elizabeth @jlarky You need to adjust a value in the bookmarklet before you can use it on your masto host.

It's currently configured to work with front-end.social, which I am on.

@bramus There's also a browser extension with similar idea. This kind of things should really be in the core. https://github.com/raikasdev/mastodon4-redirect
GitHub - raikasdev/mastodon4-redirect: Redirects users from Mastodon4 instances to their home instance

Redirects users from Mastodon4 instances to their home instance - GitHub - raikasdev/mastodon4-redirect: Redirects users from Mastodon4 instances to their home instance

GitHub

There is also web native way to do this, registering a web protocol.

Then you can make links like: `web+mstdn:follow@[email protected]` which redirects to web app that is registered to that protocol.

https://github.com/mastodon/mastodon/issues/19679

Use web-based protocol handlers to make following across instances easier · Issue #19679 · mastodon/mastodon

Pitch Use web-based protocol handlers to automatically direct follow requests to the users instance. When the User logs in to their instance for the first time, they are given an opportunity to reg...

GitHub

@bramus this is cool! @ricvolpe and I were talking about this earlier.

I made a start on an Apple Shortcut that should be able to handle this too when on iOS / iPad. It’s a little rough around the edges but as a v0.2 it does alright: https://www.icloud.com/shortcuts/90f411dd8408455787a106da34ffb016

Shortcuts

@mattjbones @bramus

great find! but the booklet doesn't work for me in Chrome. It doesn't find meta[property="profile:username"

@ricvolpe @mattjbones Do you have an example profile URL page where it doesn’t work?

@bramus @mattjbones

when viewing a user not on their primary instance

@ricvolpe @bramus

Yah this is a gotcha for sure. My Shortcut won’t handle that path yet, as it assumes that the user is ok their instance.

I wanted to avoid parsing HTML in Shortcuts but this might be a better way really

@mattjbones @ricvolpe Updated my bookmarklet. It now handles profile pages, profile pages that have moved to a different server, and status pages.

https://gist.github.com/bramus/d8bce55dab1881cde18aa2169c66ac33

Mastodon User Page Bookmarklet

Mastodon User Page Bookmarklet. GitHub Gist: instantly share code, notes, and snippets.

Gist

@bramus @ricvolpe I revisited my Shortcut, it will now look for the meta tags for username.

I might have to take inspiration from the bookmarklet though and handle those other edge cases.

https://www.icloud.com/shortcuts/458eaca0377746189525ff004c4b0678

Shortcuts

@mattjbones @bramus the other solution mentioned in the thread works well!

@bramus fun fact: this is a regression in UX.

Previously clicking that button would open a popup asking you to enter your handle (though you could also just enter `@@mstdn.social` for example and it'd still work) and it would redirect you to your instance. People even created extensions that would automatically redirect you to your home instance.

I believe this UX regression was caused by switching from static pages generated (the same as in settings) to unauthorised web app.

@bramus @Schubertsworld Or, when you see a good post on the Fediverse, click on it and then read it, evaluate and follow?
@bramus @sarajw did you look for this one?

@otherpunk @bramus thank you! That was the one, I just got pointed to it :)

I'm just going to add a #bookmarklet hashtag here so I can find it again 😅

@bramus thank you so much for writing this bookmarklet, it's exactly what I needed! 🙌

To make it easier for non-techie folks to use this, I made this:
https://andr3.gitlab.io/mastodon-follow-bookmarklet/

Let me know if that isn't ok. The code pulls directly your specific gist's code (in browser) and fully crediting you. It just makes it easier to replace the instance domain and generate the bookmarklet link if you're not familiar with that process.

@sarajw @otherpunk

Bookmarklet: Easy Follow across Mastodon Instances

@bramus If you're browsing on iOS and spot a username you want to follow (just have to have the @[email protected] address visible anywhere on screen to work!) I've made a Shortcut that does the same thing.... 👍 https://mas.to/@danielstucke/109392319645483018

I've been using it to follow people from the Twitter app as they announce their departure 😀

Daniel Stucke (@[email protected])

Attached: 1 image I made a shortcut to help with the #TwitterMigation. On an iPhone it allows you to tap your phone whenever you see someone tweeting their new Mastodon profile to take you directly to the follow screen in Mastodon. No more fumbling trying to copy and paste the URL from one app to another. Feedback welcome! #birdsite #Twitter #iOS #Shortcuts #Mastodon https://www.icloud.com/shortcuts/f0f543235aab4bd8baae77c58a555cf6

mas.to

@bramus
This should work again soon (4.02 broke it, new code has been written: https://github.com/rugk/mastodon-simplified-federation

Then hopefully the Chrome version: https://github.com/rugk/mastodon-simplified-federation/issues/55

GitHub - rugk/mastodon-simplified-federation: Simplifies following and interacting with remote users on other Mastodon instances.

Simplifies following and interacting with remote users on other Mastodon instances. - rugk/mastodon-simplified-federation

GitHub
@bramus I have not had this issue, but know others who have.
@bramus Nice addition to #Mastodon growth, well done. However there is some #Fediverse directories where you can find people with common interests to #follow. Here is one i recently started #FediLink at https://fedi.bihlink.com and it's managed via @fedilink profile
Fedi Link

Fediverse timelines, trending hastags, news, people and instances directory

Fedi Link
@bramus - I had been toying with the idea of writing a browser extension to handle the same problem. This is definitely one of the biggest annoyances of using Mastodon. Thanks for creating this!