What I’m looking for is a simple FLOSS add-on for Firefox through which the address bar recognizes Fediverse-style account handles as such, i.e. it infers the URL that corresponds to that profile and opens it. (Or alternatively: It shows that handle on one specified instance, e.g. always from your Mastodon home instance.)
Inferring the URL is of course not entirely trivial, as it depends on what software runs on the instance; but perhaps someone has already put together a solution that works reasonably well… or you would like to make one yourself.
For people with experience developing Firefox add-ons, it would be great if you share insights about what functionalities one should use to execute the redirect.
Or alternatively: It shows that handle on one specified instance, e.g. always from your Mastodon home instance.
Fwiw, PieFed already translates URLs on the backend so that visiting content from a foreign source will take you instead to the local copy.
Also this post might be tangentially interesting: https://piefed.social/post/1285215.
From the address bar? I’m not sure if that’s possible.
You can set up a custom search engine though, and if you set the URL to e.g.
https://lemmy.zip/u/%sand the keyword to something simple likel, you can just type e.g.l david_@discuss.tchncs.deand it’ll perform the replacement and go to that page.There’s an app called Mastodon Redirect for Android that does this (with Shizuku) but I’m not aware of a comparable browser extension.
You can infer the user’s id/url by querying the instance’s webfinger, like this:
curl -H Accept:\ application/jrd+json https://discuss.tchncs.de/.well-known/webfinger?resource=acct%3Adavid_%40discuss.tchncs.de | jq '.links.[] | select(.rel=="self" and .type=="application/activity+json").href'This should work for any kind of fedi instance
This must be the way to go, awesome! (I tested it with Lemmy, Mastodon and PeerTube)
Realistically speaking, this could only work as another development that’s built directly and only against Mastodon. Something that won’t work anywhere else.
These URLs are different everywhere in the Fediverse, that’s why. It’d be tedious to implement even only the most common Fediverse server applications, and it’d be even more tedious to implement them all.
For one, profile/account/channel URLs are different everywhere. Besides, the URL for someone else’s profile/account/channel on your server is different everywhere yet again.
Here are a few out of many examples. Let’s assume you’re on foo.com, and you want to look at the profile of alice@bar.org.
Lemmy users
The local scheme is <Server domain>/u/<Name>
The remote scheme is <Local server domain>/u/<Name>@<Remote server domain>
Lemmy communities
The local scheme is <Server domain>/c/<Name>
The remote scheme is <Local server domain>/c/<Name>@<Remote server domain>
Mastodon up to 4.6, also Pixelfed, Pleroma, Akkoma and apparently also GoToSocial:
The local scheme is <Server domain>/users/<Name>
The alternative local scheme is <Server domain>/@<Name>
The remote scheme is <Local server domain>/users/<Name>@<Remote server domain>
Mastodon from 4.7 on:
The local scheme is <Server domain>/ap/users/<Name>
The alternative local scheme is <Server domain>/@<Name>
The remote scheme is <Local server domain>/ap/users/<Name>@<Remote server domain>
PeerTube accounts (there’s no content to be found here):
The local scheme is <Server domain>/a/<Name> or <Server domain>/accounts/<Name>
PeerTube channels (this is where the actual videos are):
The local scheme is <Server domain>/c/<Channel name> or <Server domain>/video-channels/<Channel name>
*key:
The local scheme is <Server domain>/users/<Hash made of letters and digits>
The alternative local scheme is <Server domain>/@<Name>
WriteFreely:
The local scheme is <Server domain>/api/collections/<Name with blank spaces replaced with dashes>
Friendica:
The local scheme is <Server domain>/profile/<Name>
Hubzilla:
The local scheme is <Server domain>/channel/<Name>
The remote scheme for the local “in-between page” is <Local server domain>/chanview?f=&hash=<Full local account/channel URL of the remote account/channel>
The remote scheme for actually viewing the account/channel remotely, but using OpenWebAuth magic sign-on, is <Full local account/channel URL of the remote account/channel>?zid=<Your own local name>@<Your own local server domain>
This means that the remote URL on Hubzilla is different, depending on where the account/channel is. The remote scheme for a Hubzilla channel is different from the remote scheme for a Mastodon account, which is different from the remote scheme for a *key account, which is different from the remote scheme for a Lemmy community.
So if you want to use such an add-on, and you’re on Hubzilla, then the add-on will have to know which Fediverse server application @user@domain.tld is on.
Oh, and if that wasn’t bad enough: Not everything everywhere in the Fediverse uses @user@domain.tld. Some server applications use user@domain.tld. Friendica has done so since 2010, Hubzilla has since 2012, just to give you two examples.
So the add-on would have to cope with Fediverse handles with as well as without the leading @ and be able to tell whether that ID without the leading @ is an e-mail address, a Fediverse handle, an XMPP ID or something else again.
How does Mastodon‘s „Open URL“ work then? It works with the URLs I get from Lemmy, so it does support some other software…
In case I’m missing something, is there a good reason to not use the webfinger? It would be a simple request to https://
domain.tld/.well-known/webfinger?resource=acct:user@domain.tldand you would get everything you’re looking for




