2023-01-23
so i made a chrome extension for mastodon
in 2017
it made the 'remote follow' button as it was called then to show 'following'.
and then i kinda forget about it and until now i've overhauled the whole thing
manifest v3, promises instead of callbacks (mostly)
i just most recently got the core follow>following functionality working again.
https://chrome.google.com/webstore/detail/mastodon-friend-checker/komooichefkcbdhhhicpplicceldpcmn?hl=en&authuser=0
https://github.com/developing-today/MastodonFriendCheck/
part of manifest v3 is using background service workers that communicate with content scripts that run on the page. this all kind of was there in v2, but now it's not exactly optional.
there is a new functionality, with the increased amount of internets around mastodon, it's become apparent that there are issues around the different mastodon pages. stats you see on your home page are different than the stats on the original page. the only page that has everything is the 'show original page link' you can find in the dots on a status. more than stats, you may eventually notice that some reply are just.. missing. this can be for a lot of reasons, most of them due to federation and lag etc.
so the hard part about this is that you can't mechanically parse the url to change what instance you are on. users can post under aliases or handles, which won't parse into correct urls. @dezren39@developing.today can post a status and the status has a primary location https://social.developing.today/@dezren39/123123123. further, the post has id 123132123 at social.developing.today, but each mastodon server that caches the post will generate it's own id. usually these seem to be in the same ballpark, but nowhere near 1:1. you have to ask one of the servers involved to tell you the real answer, you cannot infer.
for profiles you must
- take the user@domain handle
- get the webfinger account from the domain
- get the profile url out of the webfinger
for statuses
options
-- you can search for the status url you already have against the server you want to go to
-- when getting to the original page, you can get the status object for the id on any server and then take the url property from there.
there are other traps, very big servers can sometimes have delays or deprioritize certain queues. very small servers may have their own performance issues and may also be insufficiently federated so their messages take time for some reason. i am very not an expert here. some messages might.. just.. not be findable on your server.
that's the whole issue actually, is no matter what though you can go from your server, to the original server, and then see all or many results.
but then, if you want to see all the replies to a reply on that thread? then you need to actually go to their original server which may or may not be the same.
these urls work, all the same post, 3 different id's for 3 different sites:
https://social.treehouse.systems/@dezren39/109742006118108141
https://hachyderm.io/@dezren39@treehouse.systems/109742006862825278
https://hachyderm.io/@dezren39@social.treehouse.systems/109742006862825278
https://social.tchncs.de/@dezren39@treehouse.systems/109742006083347535
https://social.tchncs.de/@dezren39@social.treehouse.systems/109742006083347535
this url does not work:
https://treehouse.systems/@dezren39/109742006118108141
and if you are @dezren39@hachyderm.io and you are here:
https://social.tchncs.de/@dezren39@treehouse.systems/109742006083347535
then you either want to jump to here:
https://social.treehouse.systems/@dezren39/109742006118108141
or jump to here:
https://hachyderm.io/@dezren39@treehouse.systems/109742006862825278
https://hachyderm.io/@dezren39@social.treehouse.systems/109742006862825278
and that is not a binary choice, so it can't just toggle unless you make the choice for the user. another complexity.
eventually, i'd like to be able to click follow and then it says following and i've followed the person remotely. after manifest v3 and the mastodon api/webfinger/etc, i think i've exhausted many of the main stumbling blocks to accessing mastodon.
still unused in what i've pushed is that i've got oauth app working, and 90% of the way to automatically gaining and storing an access token after auth. also tested programmatically sending statuses and following. so connecting that up to the already existing message passing and then whats left is editing the follow button hooks