mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-23 06:43:02 +01:00
fix dislike text box not being found for some users
This commit is contained in:
1 parent
dfa541ad1c
commit
596c0d730c
3 files changed
+37
-8
No files matched your search
@@ -94,10 +94,25 @@ function getLikeButton() {
|
||||
return getButtons().children[0];
|
||||
}
|
||||
|
||||
function getLikeTextContainer() {
|
||||
return (
|
||||
getLikeButton().querySelector("#text") ??
|
||||
getLikeButton().getElementsByTagName("yt-formatted-string")[0]
|
||||
);
|
||||
}
|
||||
|
||||
function getDislikeButton() {
|
||||
return getButtons().children[1];
|
||||
}
|
||||
|
||||
function getDislikeTextContainer() {
|
||||
return (
|
||||
getDislikeButton().querySelector("#text") ??
|
||||
getDislikeButton().getElementsByTagName("yt-formatted-string")[0]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
let mutationObserver = new Object();
|
||||
|
||||
if (isShorts() && mutationObserver.exists !== true) {
|
||||
@@ -197,7 +212,7 @@ function setLikes(likesCount) {
|
||||
likesCount;
|
||||
return;
|
||||
}
|
||||
getButtons().children[0].querySelector("#text").innerText = likesCount;
|
||||
getLikeTextContainer().innerText = likesCount;
|
||||
}
|
||||
|
||||
function setDislikes(dislikesCount) {
|
||||
@@ -205,7 +220,7 @@ function setDislikes(dislikesCount) {
|
||||
mobileDislikes = dislikesCount;
|
||||
return;
|
||||
}
|
||||
getButtons().children[1].querySelector("#text").innerText = dislikesCount;
|
||||
getDislikeTextContainer().innerText = dislikesCount;
|
||||
}
|
||||
|
||||
function getLikeCountFromButton() {
|
||||
|
||||
Reference in new issue
Block a user