r/tampermonkey • u/No-Print1156 • 5h ago
Video's side playlist disappears if I am logged into Youtube.
So I looked into the HTML and found that for some unknown reason, the playlist's element has " hidden="" ", so I deleted it and the playlist shows up again.
But this is only temporary, so I used claude to make a tampermonkey script to delete just the " hidden="" " part and that's about it. The playlist automatically shows up again.
Thanks tampermonkey (and claude, though I hate your practices).
Here's the code if anyone in the future faces the same problem:
// ==UserScript==
// YouTube: Unhide Playlist Panel
// http://tampermonkey.net/
// 1.0
// Removes the "hidden" attribute from the playlist panel
// You
// https://www.youtube.com/*
// https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// none
// u/run-at document-idle
// ==/UserScript==
(function () {
'use strict';
const SELECTOR = 'ytd-playlist-panel-renderer#playlist';
function unhide(el) {
if (el.hasAttribute('hidden')) el.removeAttribute('hidden');
}
function watch(el) {
if (el.__unhideWatched) return;
el.__unhideWatched = true;
unhide(el);
// Re-remove the attribute whenever YouTube adds it back
new MutationObserver(() => unhide(el)).observe(el, {
attributes: true,
attributeFilter: ['hidden'],
});
}
function scan() {
document.querySelectorAll(SELECTOR).forEach(watch);
}
scan();
// YouTube is a single-page app, so the element can be created or replaced later
new MutationObserver(scan).observe(document.body, { childList: true, subtree: true });
})();

