diff --git a/chrome/m4redirect.js b/chrome/m4redirect.js index 155f954..edffd83 100644 --- a/chrome/m4redirect.js +++ b/chrome/m4redirect.js @@ -5,7 +5,7 @@ var chrome; // If someone knows a better way to detect Mastodon4 instances, please send me a message! // raikas@techspace.social const MASTODON_DIV = document.getElementById("mastodon"); -const EXTERNAL_USER_REGEX = /^(@[a-zA-Z0-9_]+)(?!.*@)(?!\/.+)$/; // @username matches, @username@test.social @username/following doesn't +const EXTERNAL_USER_REGEX = /^\/(@[a-zA-Z0-9_]+)(?!.*@)(?!\/.+)$/; // @username matches, @username@test.social @username/following doesn't const EXTERNAL_POST_REGEX = /(@[a-zA-Z0-9_]+)(?!.*@)\/(\d+)/; // @username matches, @username@test.social doesn't if (MASTODON_DIV) { diff --git a/chrome/manifest.json b/chrome/manifest.json index 8e99be1..54f687f 100644 --- a/chrome/manifest.json +++ b/chrome/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "Mastodon4 Redirect", - "version": "1.3", + "version": "1.4", "description": "Redirects users from Mastodon4 supported instances to their home instance", "icons": { "16": "icon-16.png", diff --git a/manifest.json b/manifest.json index d4f5328..3bd39c8 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Mastodon4 Redirect", - "version": "1.3", + "version": "1.4", "description": "Redirects users from Mastodon4 supported instances to their home instance", "icons": { "48": "icon.svg", diff --git a/src/m4redirect.js b/src/m4redirect.js index 155f954..edffd83 100644 --- a/src/m4redirect.js +++ b/src/m4redirect.js @@ -5,7 +5,7 @@ var chrome; // If someone knows a better way to detect Mastodon4 instances, please send me a message! // raikas@techspace.social const MASTODON_DIV = document.getElementById("mastodon"); -const EXTERNAL_USER_REGEX = /^(@[a-zA-Z0-9_]+)(?!.*@)(?!\/.+)$/; // @username matches, @username@test.social @username/following doesn't +const EXTERNAL_USER_REGEX = /^\/(@[a-zA-Z0-9_]+)(?!.*@)(?!\/.+)$/; // @username matches, @username@test.social @username/following doesn't const EXTERNAL_POST_REGEX = /(@[a-zA-Z0-9_]+)(?!.*@)\/(\d+)/; // @username matches, @username@test.social doesn't if (MASTODON_DIV) {