mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-22 06:13:07 +01:00
Merge pull request #215 from mphelp/issue-180
Fix issue 180: Clips not working
This commit is contained in:
2 files changed
+12
-4
No files matched your search
@@ -158,8 +158,12 @@ const NEUTRAL_STATE = "NEUTRAL_STATE";
|
||||
|
||||
function getVideoId(url) {
|
||||
const urlObject = new URL(url);
|
||||
const videoId = urlObject.searchParams.get("v");
|
||||
return videoId;
|
||||
const pathname = urlObject.pathname;
|
||||
if (pathname.startsWith('/clips')) {
|
||||
return document.querySelector("meta[itemprop='videoId']").content;
|
||||
} else {
|
||||
return urlObject.searchParams.get("v");
|
||||
}
|
||||
}
|
||||
|
||||
function isVideoLoaded() {
|
||||
|
||||
@@ -150,8 +150,12 @@ function setInitialState() {
|
||||
|
||||
function getVideoId(url) {
|
||||
const urlObject = new URL(url);
|
||||
const videoId = urlObject.searchParams.get("v");
|
||||
return videoId;
|
||||
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