Show dislikes again on new YT UI (01)

Signed-off-by: sy-b <94835959+sy-b@users.noreply.github.com>
This commit is contained in:
sy-b authored and GitHub committed 2023-02-16 17:54:12 +05:30
1 parent d12539d3bb
commit 44d1ea390f
1 file changed
+11
+11
View File
@@ -151,6 +151,17 @@ function setDislikes(dislikesCount) {
return;
}
getDislikeTextContainer().innerText = dislikesCount;
try {
likeButton = document.querySelector("#segmented-like-button > ytd-toggle-button-renderer > yt-button-shape > button > div.cbox.yt-spec-button-shape-next--button-text-content > span")
dislikeButton = document.querySelector("#segmented-dislike-button > ytd-toggle-button-renderer > yt-button-shape > button")
}
finally {
dislikeButton.appendChild(likeButton.cloneNode(true))
document.querySelector('#segmented-dislike-button > ytd-toggle-button-renderer > yt-button-shape > button').classList.remove('yt-spec-button-shape-next--icon-button')
dislikeButton.lastChild.textContent = dislikesCount
}
} else {
cLog("likes count disabled by creator");
if (isMobile()) {