ID: I202603161425
Status: idea
Tags: Tampermonkey, pastebin
youtube feed webscript
I created the script below to redirect me away from my feed and from the shorts.
// ==UserScript==
// @name YouTube Home to Subscriptions
// @namespace http://tampermonkey.net/
// @version 0.4
// @description Redirect youtube.com home and shorts to subscriptions feed and remove logo
// @author You
// @match https://www.youtube.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
function checkAndRedirect() {
const path = window.location.pathname;
const search = window.location.search;
// Check if current URL is youtube.com home or shorts
if (
(path === '/' && search === '') ||
path.startsWith('/shorts/')
) {
window.location.href =
'https://www.youtube.com/feed/subscriptions';
}
}
function removeLogo() {
const logo = document.getElementById('logo');
if (logo) {
logo.remove();
}
}
// Check immediately on load
checkAndRedirect();
removeLogo();
// Check every 5 seconds
setInterval(checkAndRedirect, 5000);
// Remove logo when DOM changes
const observer = new MutationObserver(removeLogo);
observer.observe(document.body, {
childList: true,
subtree: true
});
})();