// ==UserScript==
// @name YouTube Play All
// @description Adds the Play-All-Button to the videos section of a YouTube-Channel
// @version 2024-03-21
// @author Robert Wesner (https://robert.wesner.io)
// @license MIT
// @namespace http://robert.wesner.io/
// @match https://www.youtube.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// @downloadURL none
// ==/UserScript==
(function() {
'use strict';
document.head.insertAdjacentHTML('beforeend', ``);
setInterval(() => {
if (!window.location.pathname.endsWith('/videos') || document.querySelector('.play-all-button')) {
return;
}
fetch('.')
.then(_ => _.text())
.then(html => {
const i = html.indexOf(' adds shorts into the playlist, list=UULF only has actual videos
document.querySelector('ytd-feed-filter-chip-bar-renderer').querySelector('iron-selector#chips').insertAdjacentHTML('beforeend', `
Play All
`);
});
}, 5000);
})();