Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube committed Sep 29, 2023
1 parent c587180 commit 36ddb27
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions js&css/web-accessible/www.youtube.com/playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ ImprovedTube.playlistRepeat = function () {
setTimeout(function (){
var option = ImprovedTube.storage.playlist_repeat,
button = document.querySelector("#button.ytd-playlist-loop-button-renderer") || document.querySelector("ytd-playlist-loop-button-renderer button") || document.querySelector("ytd-playlist-loop-button-renderer");
svg = button.querySelector("path").attributes.d.textContent.split(" ")[0];
if (button && (option === true && svg.startsWith('M21')
if (button && (option === true && button.querySelector("path").attributes.d.textContent.split(" ")[0];.startsWith('M21')
) && button.querySelector("#tooltip")?.textContent !== 'Loop video'
&& button.firstElementChild?.firstElementChild?.attributes[2]?.textContent !== 'Loop video'
&& button.querySelector("#tooltip")?.textContent !== 'Turn off loop'
Expand All @@ -125,8 +124,7 @@ ImprovedTube.playlistShuffle = function () {
var button = ImprovedTube.elements.playlist.shuffle_button,
option = ImprovedTube.storage.playlist_shuffle;
button = document.querySelector('#playlist-actions #playlist-action-menu ytd-toggle-button-renderer');
svg = button.querySelector("path").attributes.d.textContent.split(" ")[0];
if (button && (option === true && svg.startsWith('M18.1')
if (button && (option === true && button.querySelector("path").attributes.d.textContent.split(" ")[0].startsWith('M18.1')
) )
{ button.click(); }
}, 5000);
Expand Down

0 comments on commit 36ddb27

Please sign in to comment.