mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-02 02:41:22 +01:00
Replace deprecated String.prototype.substr()
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
2 files changed
+2
-2
No files matched your search
@@ -313,7 +313,7 @@ function getVideoId() {
|
|||||||
return document.querySelector("meta[itemprop='videoId']").content;
|
return document.querySelector("meta[itemprop='videoId']").content;
|
||||||
} else {
|
} else {
|
||||||
if (pathname.startsWith("/shorts")) {
|
if (pathname.startsWith("/shorts")) {
|
||||||
return pathname.substr(8);
|
return pathname.slice(8);
|
||||||
}
|
}
|
||||||
return urlObject.searchParams.get("v");
|
return urlObject.searchParams.get("v");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ function getVideoId(url) {
|
|||||||
return document.querySelector("meta[itemprop='videoId']").content;
|
return document.querySelector("meta[itemprop='videoId']").content;
|
||||||
} else {
|
} else {
|
||||||
if (pathname.startsWith("/shorts")) {
|
if (pathname.startsWith("/shorts")) {
|
||||||
return pathname.substr(8);
|
return pathname.slice(8);
|
||||||
}
|
}
|
||||||
return urlObject.searchParams.get("v");
|
return urlObject.searchParams.get("v");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user