mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-24 07:13:02 +01:00
Merge pull request #281 from evanreichard/patch-2
[fix] YouTube Mobile Locale URL Doesn't Exist
This commit is contained in:
1 file changed
+6
-6
@@ -354,14 +354,14 @@ function roundDown(num) {
|
||||
}
|
||||
|
||||
function numberFormat(numberState) {
|
||||
const userLocales = new URL(
|
||||
Array.from(document.querySelectorAll("head > link[rel='search']"))
|
||||
?.find((n) => n?.getAttribute("href")?.includes("?locale="))
|
||||
?.getAttribute("href")
|
||||
)?.searchParams?.get("locale");
|
||||
let localeURL = Array.from(document.querySelectorAll("head > link[rel='search']"))
|
||||
?.find((n) => n?.getAttribute("href")?.includes("?locale="))
|
||||
?.getAttribute("href");
|
||||
|
||||
const userLocales = localeURL ? new URL(localeURL)?.searchParams?.get("locale") : document.body.lang;
|
||||
|
||||
const formatter = Intl.NumberFormat(
|
||||
document.documentElement.lang || userLocales,
|
||||
document.documentElement.lang || userLocales || navigator.language,
|
||||
{
|
||||
notation: "compact",
|
||||
minimumFractionDigits: 1,
|
||||
|
||||
Reference in new issue
Block a user