From c22f5c4b39ba545508392343fc0ffcfa4775dfdb Mon Sep 17 00:00:00 2001 From: Vladimir Morozov Date: Thu, 4 Apr 2019 08:56:46 +0300 Subject: [PATCH] code cleanup --- src/js/plugins/youtube.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/js/plugins/youtube.js b/src/js/plugins/youtube.js index cac1a90f..1f827776 100644 --- a/src/js/plugins/youtube.js +++ b/src/js/plugins/youtube.js @@ -34,20 +34,12 @@ function assurePlaybackState(play) { } } -function useHttp() { - return !window.location.href.includes('https://'); -} - function getYoutubeHost(config) { - let host; - if (config.noCookie) { - host = 'https://www.youtube-nocookie.com'; - } else { - host = useHttp() ? 'http://www.youtube.com' : undefined; + return 'https://www.youtube-nocookie.com'; } - return host; + return `${window.location.protocol}//www.youtube.com`; } const youtube = {