bramus / mastodon-redirector

View Mastodon profiles on your Mastodon instance

Home Page:https://chrome.google.com/webstore/detail/mastodon-view-profile/limifnkopacddgpihodacjeckfkpbfoe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplicated instance domain while redirecting

alexbraga opened this issue · comments

This behavior was observed while trying to redirect from @mastodon.social. For what I can tell, redirecting from other instances seem to be working fine (I haven't tried many, though), however redirecting from @mastodon.social ends up with the following URL pattern: https://myinstance.org/@username@mastodon.socialmastodon.social

I'm on Firefox 124.0.1
Arch Linux

Ran into the same issue.

I changed both of those lines:

const userFromProfilePage = document.querySelector('.account__header .account__header__tabs__name small')?.innerText.substring(1);

const userFromProfilePage = document.querySelector('.account__header .account__header__tabs__name small')?.innerText.substring(1);

to

const userFromProfilePage = document.head.querySelector('meta[property="profile:username"]')?.content;

which seems to have worked. I'm not that familiar with all various versions and/or mods of mastodon, so I'll refrain from opening a PR, but maybe changing those two lines might work for some.