View at Home is a simple Tampermonkey script to make interacting with Mastodon (and probably other Fediverse services) easier. When you open a Mastodon post, it’s not possible to comment or favourite it unless it’s on your own home instance. The usual way of dealing with this is by copying the link into the search box of your own instance and clicking the resulting link.

This script will add a “View at home” button to the top left of the page when you look at a Mastodon site. By clicking on this button, it will search for that page on your own Mastodon instance and then redirect you home so you can comment or favourite it.

When you install it, it will give you dire warnings about the extra capabilities it requires. These are needed to make the search on your home instance, and to save the hostname of your home instance in Local Storage in your browser. Please read through the code to be sure you trust what it is doing, as the permissions are wide-ranging.
The first time you run it, the script will ask for your home Mastodon instance. Enter the hostname, without the protocol in this box, and it will be saved to the browser Local Storage. If you get it wrong, click the “Reset Config” button, and it will show you the same popup.
ChatGPT4 was used to help write this script, with edits and prompts by me when it wasn’t exactly what I wanted.
This is a first release. If you find any bugs or have suggestions, please create a GitHub issue in the View at Home repository, comment on this post, or contact me on Mastodon.