yet another simple YouTube video likes/dislikes ratio display

Show likes/dislikes ratio of YouTube video.

< Feedback on yet another simple YouTube video likes/dislikes ratio display

Review: Good - script works

§
Posted: 2021-04-13
Edited: 2021-04-13

(内含解决方案)脚本失效,Youtube 今天更改了 DOM 结构。

具体来说,在 ytd-thumbnail 与目标容器 #details 之间多出了一个 #preview-loading-overlay,造成 nextElementSibling 指向错误。

解决方法是将第96至101行

video.parentElement.nextElementSibling
    .querySelector("#metadata-line")
    .appendChild(dot);
video.parentElement.nextElementSibling
    .querySelector("#metadata-line")
    .appendChild(ratioDiv);

替换为

const line = video.closest("#dismissible").querySelector("#metadata-line");
line.appendChild(dot);
line.appendChild(ratioDiv);
§
Posted: 2021-05-03

Youtube 看起来是又改回来了,现在恢复正常了

§
Posted: 2021-09-14

现在又显示不了了

Post reply

Sign in to post a reply.