Lartsch / FediAct

Chrome/Firefox extension that simplifies interactions on other Mastodon instances than your own.
MIT License
462 stars 14 forks source link

Bug: Does not match recursive profile URLs #1

Closed LeviSnoot closed 1 year ago

LeviSnoot commented 1 year ago

First of all, thank you for making this extension. It's the only one of its kind I can find that actually does what I want it to. Great work!

Before I follow someone I like to browse the profiles media tab, and see who they're following etc. The issue I'm running into here is the extension does not match URLs underneath the path https://instance.xyz/@username

So for example https://instance.xyz/@username/media, https://instance.xyz/@username/following etc. don't work.

I believe it should be a fairly simple regex fix but I'm not confident I'll be able to fix it myself which is why I'm not making a PR. However I tested the following string on regex101 and it appears to match everything we want.

/(http|https):\/\/.*\/@.*/gim

image

Lartsch commented 1 year ago

Hi! Fixed in the latest update :) I also noticed it while working on the latest update... Now found your issue.

Thanks for creating the issue.

Lartsch commented 1 year ago

btw., that's the regex if you want to try it out

const followPageRegex = /^(https?:\/\/(www\.)?.*\..*?\/)((@\w+(@([\w-]+\.)+?\w+)?)|explore|following|followers)\/?(\d+)?\/?$/;

/explore can contain follow buttons on v3 instances

// edit: apparently the backslash was escaped by github, now its wrapped in code and therefore not escaped :)