mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-03 19:31:20 +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
+5
-5
@@ -354,14 +354,14 @@ function roundDown(num) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function numberFormat(numberState) {
|
function numberFormat(numberState) {
|
||||||
const userLocales = new URL(
|
let localeURL = Array.from(document.querySelectorAll("head > link[rel='search']"))
|
||||||
Array.from(document.querySelectorAll("head > link[rel='search']"))
|
|
||||||
?.find((n) => n?.getAttribute("href")?.includes("?locale="))
|
?.find((n) => n?.getAttribute("href")?.includes("?locale="))
|
||||||
?.getAttribute("href")
|
?.getAttribute("href");
|
||||||
)?.searchParams?.get("locale");
|
|
||||||
|
const userLocales = localeURL ? new URL(localeURL)?.searchParams?.get("locale") : document.body.lang;
|
||||||
|
|
||||||
const formatter = Intl.NumberFormat(
|
const formatter = Intl.NumberFormat(
|
||||||
document.documentElement.lang || userLocales,
|
document.documentElement.lang || userLocales || navigator.language,
|
||||||
{
|
{
|
||||||
notation: "compact",
|
notation: "compact",
|
||||||
minimumFractionDigits: 1,
|
minimumFractionDigits: 1,
|
||||||
|
|||||||
Reference in new issue
Block a user