Merge pull request #517 from CommanderRoot/refactor/rm-deprecated-substr

Replace deprecated String.prototype.substr()
This commit is contained in:
Dmitrii Selivanov authored and GitHub committed 2022-03-26 22:40:02 +03:00
commit ef60470755
2 files changed
+2 -2

No files matched your search

@@ -313,7 +313,7 @@ function getVideoId() {
return document.querySelector("meta[itemprop='videoId']").content;
} else {
if (pathname.startsWith("/shorts")) {
return pathname.substr(8);
return pathname.slice(8);
}
return urlObject.searchParams.get("v");
}
+1 -1
View File
@@ -79,7 +79,7 @@ function getVideoId(url) {
return document.querySelector("meta[itemprop='videoId']").content;
} else {
if (pathname.startsWith("/shorts")) {
return pathname.substr(8);
return pathname.slice(8);
}
return urlObject.searchParams.get("v");
}