Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Anarios/return-youtube-dislike.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Extensions')
-rw-r--r--Extensions/UserScript/Return Youtube Dislike.user.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/Extensions/UserScript/Return Youtube Dislike.user.js b/Extensions/UserScript/Return Youtube Dislike.user.js
index a790a1c..2cdad78 100644
--- a/Extensions/UserScript/Return Youtube Dislike.user.js
+++ b/Extensions/UserScript/Return Youtube Dislike.user.js
@@ -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,