From 30bcc2fa64829deba17a755603e0aa517ca839ca Mon Sep 17 00:00:00 2001 From: MAZ <29178226+MAZ01001@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:56:40 +0200 Subject: [PATCH] Update player.js added playlist to video popup button ( #1805 [1] ) --- js&css/web-accessible/www.youtube.com/player.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index 6ad1dd6cd..2eb7a5cef 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -728,7 +728,11 @@ ImprovedTube.playerPopupButton = function () { player.pauseVideo(); - window.open('//www.youtube.com/embed/' + location.href.match(/watch\?v=([A-Za-z0-9\-\_]+)/g)[0].slice(8) + '?start=' + parseInt(player.getCurrentTime()) + '&autoplay=' + (ImprovedTube.storage.player_autoplay == false ? '0' : '1'), '_blank', 'directories=no,toolbar=no,location=no,menubar=no,status=no,titlebar=no,scrollbars=no,resizable=no,width=' + player.offsetWidth + ',height=' + player.offsetHeight); + let urlPopup = `${location.protocol}//www.youtube.com/embed/${location.search.match(ImprovedTube.regex.video_id)[1]}?start=${parseInt(player.getCurrentTime())}&autoplay=${(ImprovedTube.storage.player_autoplay ?? true) ? '1' : '0'}`; + const listMatch = location.search.match(ImprovedTube.regex.playlist_id); + if (listMatch) urlPopup += `&list=${listMatch[1]}`; + + window.open(urlPopup, '_blank', `directories=no,toolbar=no,location=no,menubar=no,status=no,titlebar=no,scrollbars=no,resizable=no,width=${player.offsetWidth},height=${player.offsetHeight}`); }, title: 'Popup' });