diff --git a/js&css/web-accessible/functions.js b/js&css/web-accessible/functions.js index ff21759c5..b779975ba 100644 --- a/js&css/web-accessible/functions.js +++ b/js&css/web-accessible/functions.js @@ -382,10 +382,12 @@ ImprovedTube.videoPageUpdate = function () { ImprovedTube.playerControls(); // Initialize large playlist handler for playlist videos - if (this.getParam(location.href, 'list')) { + // Skip queue-type playlists (WL, RD, etc.) to prevent interference + var listId = this.getParam(location.href, 'list'); + if (listId && listId !== 'WL' && listId !== 'RD' && listId.indexOf('RDAMVM') !== 0 && listId.indexOf('OLAK5uy_') !== 0) { ImprovedTube.playlistLargePlaylistHandler(); } else { - // Cleanup when not on a playlist + // Cleanup when not on a playlist or on a queue-type playlist if (typeof ImprovedTube.cleanupPlaylistHandlers === 'function') { ImprovedTube.cleanupPlaylistHandlers(); } diff --git a/js&css/web-accessible/www.youtube.com/playlist.js b/js&css/web-accessible/www.youtube.com/playlist.js index 40fc5b105..81a0a5117 100644 --- a/js&css/web-accessible/www.youtube.com/playlist.js +++ b/js&css/web-accessible/www.youtube.com/playlist.js @@ -22,9 +22,19 @@ ImprovedTube.playlistUpNextAutoplay = function () { // currentIndex and localCurrentIndex to desync at chunk boundaries. // This handler keeps them in sync so autoplay continues working. // Only runs when playlist_up_next_autoplay is NOT disabled. +// ⚠️ Skip queue-type playlists (WL=Watch Later, RD=Radio, OLAK5uy_=auto-mix) +// to prevent interference with YouTube's queue autoplay behavior. ImprovedTube.playlistLargePlaylistHandler = function() { if (!this.getParam(location.href, 'list')) return; + // Skip queue-type playlists — these are not regular user playlists + // and the index sync logic can interfere with YouTube's queue autoplay + var listId = this.getParam(location.href, 'list'); + if (listId === 'WL' || listId === 'RD' || listId.indexOf('RDAMVM') === 0 || listId.indexOf('OLAK5uy_') === 0) { + this.cleanupPlaylistHandlers(); + return; + } + // Do not sync indices if the user has disabled playlist autoplay, // because playlistUpNextAutoplay intentionally sets currentIndex // to totalVideos to prevent the next video from playing.