Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@drt24
drt24 / bookmarklet.js
Last active November 24, 2022 10:46 — forked from bramus/bookmarklet.md
Mastodon User Page Bookmarklet
javascript:(function(){
const MY_MASTO_LOCAL_DOMAIN = 'social.coop'; /* 👈 Change this value */
const MY_MASTO_WEB_DOMAIN = MY_MASTO_LOCAL_DOMAIN; /* 👈 Only change this value if your Masto host is hosted an different domain than the LOCAL_DOMAIN */
function tryAndGetUserName() {
/* Profile with a moved banner (e.g. https://mastodon.social/@bramus): follow that link */
const userNewProfile = document.querySelector('.moved-account-banner .button')?.getAttribute('href');
if (userNewProfile) {
return userNewProfile.substring(2);
}