mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-22 22:33:01 +01:00
add support for new yt layout
This commit is contained in:
1 parent
9a7554ba3c
commit
da184d75ff
1 file changed
+7
-3
@@ -82,7 +82,10 @@ function getButtons() {
|
||||
return document.querySelector(".slim-video-action-bar-actions");
|
||||
}
|
||||
if (document.getElementById("menu-container")?.offsetParent === null) {
|
||||
return document.querySelector("ytd-menu-renderer.ytd-watch-metadata > div");
|
||||
return (
|
||||
document.querySelector("ytd-menu-renderer.ytd-watch-metadata > div") ??
|
||||
document.querySelector("ytd-menu-renderer.ytd-video-primary-info-renderer > div")
|
||||
)
|
||||
} else {
|
||||
return document
|
||||
.getElementById("menu-container")
|
||||
@@ -108,7 +111,8 @@ function getDislikeButton() {
|
||||
function getDislikeTextContainer() {
|
||||
return (
|
||||
getDislikeButton().querySelector("#text") ??
|
||||
getDislikeButton().getElementsByTagName("yt-formatted-string")[0]
|
||||
getDislikeButton().getElementsByTagName("yt-formatted-string")[0] ??
|
||||
getDislikeButton().querySelector("span[role='text']")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -594,7 +598,7 @@ function setEventListeners(evt) {
|
||||
let jsInitChecktimer;
|
||||
|
||||
function checkForJS_Finish() {
|
||||
console.log();
|
||||
//console.log();
|
||||
if (isShorts() || (getButtons()?.offsetParent && isVideoLoaded())) {
|
||||
const buttons = getButtons();
|
||||
|
||||
|
||||
Reference in new issue
Block a user