improving fav detection logic

This commit is contained in:
x
2026-01-23 21:38:47 +01:00
parent 9c25f89adc
commit 8af49b6ec1
2 changed files with 8 additions and 3 deletions

View File

@@ -227,7 +227,7 @@ window.requestAnimFrame = (function () {
const userMatch = url.match(/\/user\/([^/]+)/);
if (userMatch) {
user = decodeURIComponent(userMatch[1]);
if (url.includes(`/user/${userMatch[1]}/favs`)) isFavs = true;
if (url.match(/\/user\/[^/]+\/favs(\/|$|\?)/)) isFavs = true;
}
// If missing and inheritContext is true, check Window Location
@@ -240,7 +240,8 @@ window.requestAnimFrame = (function () {
const wUserMatch = window.location.href.match(/\/user\/([^/]+)/);
if (wUserMatch) {
user = decodeURIComponent(wUserMatch[1]);
if (window.location.href.includes(`/user/${wUserMatch[1]}/favs`)) isFavs = true;
// Check for /favs (with or without trailing /, item id, or query params)
if (window.location.href.match(/\/user\/[^/]+\/favs(\/|$|\?)/)) isFavs = true;
}
}
}