mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-02 19:01:21 +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");
|
return document.querySelector(".slim-video-action-bar-actions");
|
||||||
}
|
}
|
||||||
if (document.getElementById("menu-container")?.offsetParent === null) {
|
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 {
|
} else {
|
||||||
return document
|
return document
|
||||||
.getElementById("menu-container")
|
.getElementById("menu-container")
|
||||||
@@ -108,7 +111,8 @@ function getDislikeButton() {
|
|||||||
function getDislikeTextContainer() {
|
function getDislikeTextContainer() {
|
||||||
return (
|
return (
|
||||||
getDislikeButton().querySelector("#text") ??
|
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;
|
let jsInitChecktimer;
|
||||||
|
|
||||||
function checkForJS_Finish() {
|
function checkForJS_Finish() {
|
||||||
console.log();
|
//console.log();
|
||||||
if (isShorts() || (getButtons()?.offsetParent && isVideoLoaded())) {
|
if (isShorts() || (getButtons()?.offsetParent && isVideoLoaded())) {
|
||||||
const buttons = getButtons();
|
const buttons = getButtons();
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user