Chrome/Firefox Clips functionality

This commit is contained in:
mphelp committed 2021-12-05 14:57:59 -06:00
1 parent c1a12b0bf7
commit 347a4ea03b
2 files changed
+12 -4

No files matched your search

@@ -154,8 +154,12 @@
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() {
@@ -140,8 +140,12 @@ function setInitalState() {
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() {