mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2026-01-31 06:41:01 +03:00
Formatting
This commit is contained in:
8
utils.js
8
utils.js
@@ -19,16 +19,16 @@ async function wait(condition, timeout = 5000, check = 100) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getYouTubeVideoID(url) {
|
function getYouTubeVideoID(url) {
|
||||||
|
// For YouTube TV support
|
||||||
if(document.URL.startsWith("https://www.youtube.com/tv#/")) url = url.replace("#", "");
|
if(document.URL.startsWith("https://www.youtube.com/tv#/")) url = url.replace("#", "");
|
||||||
|
|
||||||
//Attempt to parse url
|
//Attempt to parse url
|
||||||
let urlObject = null;
|
let urlObject = null;
|
||||||
try {
|
try {
|
||||||
urlObject = new URL(url);
|
urlObject = new URL(url);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("[SB] Unable to parse URL: " + url);
|
console.error("[SB] Unable to parse URL: " + url);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if valid hostname
|
//Check if valid hostname
|
||||||
|
|||||||
Reference in New Issue
Block a user