Formatting

This commit is contained in:
Ajay Ramachandran
2019-12-29 16:48:10 -05:00
parent f74e25a482
commit fe608b579e

View File

@@ -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