mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-22 14:23:01 +01:00
Merge branch 'main' into main
This commit is contained in:
3 files changed
+22
-19
No files matched your search
@@ -40,7 +40,7 @@ function getButtons() {
|
||||
if (isMobile) {
|
||||
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");
|
||||
} else {
|
||||
return document
|
||||
@@ -303,10 +303,13 @@ function setInitialState() {
|
||||
}
|
||||
|
||||
function getVideoId() {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const videoId = urlParams.get("v");
|
||||
|
||||
return videoId;
|
||||
const urlObject = new URL(window.location.href);
|
||||
const pathname = urlObject.pathname;
|
||||
if (pathname.startsWith('/clips')) {
|
||||
return document.querySelector("meta[itemprop='videoId']").content;
|
||||
} else {
|
||||
return urlObject.searchParams.get("v");
|
||||
}
|
||||
}
|
||||
|
||||
function isVideoLoaded() {
|
||||
|
||||
Reference in new issue
Block a user