mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-01 10:21:22 +01:00
Merge pull request #1 from bstka/main
Update script.js: formatted dislike counter
This commit is contained in:
1 file changed
+7
@@ -55,6 +55,7 @@ function setState() {
|
|||||||
},
|
},
|
||||||
function (response) {
|
function (response) {
|
||||||
if (response != undefined) {
|
if (response != undefined) {
|
||||||
|
const formattedDislike = numberFormat(response.dislikes);
|
||||||
// setLikes(response.likes);
|
// setLikes(response.likes);
|
||||||
console.log(response);
|
console.log(response);
|
||||||
setDislikes(response.dislikes);
|
setDislikes(response.dislikes);
|
||||||
@@ -91,6 +92,12 @@ function isVideoLoaded() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function numberFormat(numberState) {
|
||||||
|
const userLocales = navigator.language;
|
||||||
|
const formatter = Intl.NumberFormat(userLocales, { notation: 'compact' });
|
||||||
|
return formatter.format(numberState);
|
||||||
|
}
|
||||||
|
|
||||||
function setEventListeners(evt) {
|
function setEventListeners(evt) {
|
||||||
function checkForJS_Finish() {
|
function checkForJS_Finish() {
|
||||||
if (getButtons()?.offsetParent && isVideoLoaded()) {
|
if (getButtons()?.offsetParent && isVideoLoaded()) {
|
||||||
|
|||||||
Reference in new issue
Block a user