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 instance that hosts your account. Same story with favoriting and boosting their posts, when viewed on their instance’s URL.
To make things easier, I’ve created a browser extension that can rewrite external Mastodon URLs to URLs as seen on your Mastodon instance.
~
# Demo
This demo shows Chrome with the extension running. My Mastodon host is front-end.social
. After configuring the extension, I can quickly jump from other Mastodon instances to the instance that hosts my account. From there, I can follow/favorite/boost the profile/post I was visiting before.
For example, Zach Leatherman’s profile is reachable at https://fediverse.zachleat.com/@zachleat
. Because I have an account on the front-end.social
instance, the URL that I can use to interact with him is https://front-end.social/@zachleat@zachleat.com
. The extension takes care of this for me by injecting a link in the modal that is shown.
Alternatively I can press the extension button itself – or use the SHIFT
+ALT/OPT
+M
shortcut – to get redirected.
~
# Get the extension
The extension is available on the Chrome Web Store and Mozilla Add-Ons Website. If you can’t or don’t want to run this as an extension, you can also use the bookmarklets.
The source code of the extension is available on GitHub. If you like the extension, please leave a review on the relevant extension store. Bugs can be filed in the repo.
~
# Backstory
When I joined Mastodon back in November 2023, this almost immediately was one of the things that nagged me: whenever I visited someone’s profile or a link to a post on a different instance I could not follow them nor favorite/boost their posts. Instead, I needed to go to my instance, look up their name, and then find back the post that way.
(It was only later that I discovered that you can search for a remote URL on your local instance and it’ll redirect to the local version when doing so)
To not have to rewrite these URLs manually, I rather quickly created a bookmarklet to rewrite profile URLs. As an experiment a few days later – to get myself acquainted with Extensions Manifest v3 – I turned that into a browser extension for use with Google Chrome (+ other Chromium derivatives) and Mozilla Firefox.
The extension was released under the name “Mastodon Profile Redirector”, as that what the extension only did back then: upon pressing the extension button, it would redirect you to the profile page served by your instance.
Later on in December 2022, I added a Content Script to the extension which monitors follow dialogs on Mastodon pages. Whenever such a dialog got shown, the extension injects a button that directly links to the profile on your own instance. This feature got released in version 0.3.0.
A feature that was long missing was the ability to rewrite individual posts. Even though I knew how to build it, I never got round to implementing this. Last week, I finally made some time to do so and released version 0.4.0 which includes this feature. Also new is a shortcut to invoke the redirection. Hit SHIFT
+ALT/OPT
+M
on a Mastodon profile page or Mastodon post detail page, and you’ll be redirected. Because of this expanded scope of the extension, it also got renamed to “Mastodon Redirector”.
~
# Spread the word
To help spread the contents of this post, feel free to retweet its announcement tweetpost/tootpost:
I made something to make my browsing experience on That Other Social Network much better. Maybe it’ll be of good use for you as well.
Available on the Chrome Web Store and the Firefox AMO website. In non-supported browsers you can use the provided bookmarklets. Source on GitHub. https://t.co/7Yv5RDpun0
— Bramus (@bramus) September 11, 2023
~
🔥 Like what you see? Want to stay in the loop? Here's how:
Thank you Bramus for adding a LOCAL_DOMAIN *and* a WEB_DOMAIN setting!