3 ms·
create a new folder, put two files there: manifest.json containing: { "manifest_version": 3, "name": "Hide YouTube Shorts", "version": "1.0", "descrip
by polotics 1y ago
create a new folder, put two files there:
manifest.json
containing:
{
"manifest_version": 3,
"name": "Hide YouTube Shorts",
"version": "1.0",
"description": "Hides YouTube Shorts",
"content_scripts": [
{
"matches": ["://www.youtube.com/"],
"js": ["content.js"]
}
]
}
and a file named content.js
containing:
function hideShorts() {
const shorts = document.querySelectorAll('ytd-rich-shelf-renderer[is-shorts]');
shorts.forEach(short => {
short.style.display = 'none';
});
}
hideShorts();
const observer = new MutationObserver(hideShorts);
observer.observe(document.body, { childList: true, subtree: true });
add the contents of this folder as a chrome extension
- insin 1y agoHere's a more comprehensive BYO Shorts-hiding extension which uses CSS instead of running JavaScript every time an element is added or removed anywhere in the DOM, and also supports the mobile version (CSS selectors are extracted from the https://soitis.dev/control-panel-for-youtube https://soitis.dev/control-panel-for-youtube Hide Shorts feature) https://gist.github.com/insin/ef93c7d87b1f97f1c9411e6128d52053 https://gist.github.com/insin/ef93c7d87b1f97f1c9411e6128d520...