improving fav detection logic
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user