by susam · 9mo ago · 0 comments
// ==UserScript==
// @name No YT Sidebar and Shorts
// @match https://www.youtube.com/*
// ==/UserScript==
function noYTSidebar () {
const element = document.getElementById('secondary')
if (element === null) {
window.setTimeout(noYTSidebar, 1000)
return
}
element.getElementById('secondary').style.display = 'none'
}
function noYTShorts () {
const elements = document.querySelectorAll('ytd-rich-shelf-renderer')
if (elements.length === 0) {
window.setTimeout(noYTShorts, 1000)
return
}
for (e of document.querySelectorAll('ytd-rich-shelf-renderer')) {
e.style.display = 'none'
}
}
noYTSidebar()
noYTShorts()https://addons.mozilla.org/en-US/firefox/addon/remove-youtub...
(function () {
const css = `
#secondary { display: none }
.ytd-rich-shelf-renderer { display: none }
`
const style = document.createElement('style')
style.textContent = css
document.head.appendChild(style)
})()