mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-22 22:33:01 +01:00
Merge pull request #219 from mphelp/issue-180
Fix Issue 180: Forgot userscript clips fix
This commit is contained in:
1 file changed
+7
-4
@@ -265,10 +265,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