userstuff: switch hsmusic websites: fix some path extraction
HEAD main1 files changed, 2 insertions, 2 deletions
diff --git a/userstuff/hsmusic/Switch HSMusic websites.user.js b/userstuff/hsmusic/Switch HSMusic websites.user.js
index 47c2d0b..a36a138 100644
--- a/userstuff/hsmusic/Switch HSMusic websites.user.js
+++ b/userstuff/hsmusic/Switch HSMusic websites.user.js
@@ -59,12 +59,12 @@ customNavLink('L', 'http://localhost:8002');
customNavLink('P', 'https://preview.hsmusic.wiki');
customNavLink('R', 'https://hsmusic.wiki');
-let match = location.href.match(/album\/([^/]*)/);
+let match = location.href.match(/\/album\/([^/]*)/);
if (match) {
customNavLink('G', () => `https://github.com/hsmusic/hsmusic-data/tree/preview/album/${match[1]}.yaml`);
}
-match = location.href.match(/track\/([^/]*)/);
+match = location.href.match(/\/track\/([^/]*)/);
if (match) {
const directory = getComputedStyle(document.body).getPropertyValue('--album-directory');
customNavLink('G', () => `https://github.com/hsmusic/hsmusic-data/tree/preview/album/${directory}.yaml`);
|