Greasy Fork is available in English.
Empêche les notifications pour les vidéos "Shorts" sur YouTube
- // ==UserScript==// @name DYSN (Disable YouTube Shorts Notifications)// @namespace http://tampermonkey.net/// @version 1.4// @description Empêche les notifications pour les vidéos "Shorts" sur YouTube// @author yglsan// @match https://www.youtube.com/*// @grant none// @run-at document-start// @license GPL-3.0-or-later ### cf. terms of the Gnu General Public License between /* */ symbols ###// ==/UserScript==/*GNU GENERAL PUBLIC LICENSEVersion 3, 29 June 2007Copyright (C) 2025 yglsanThis program is free software: you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation, either version 3 of the License, or(at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program. If not, see <https://www.gnu.org/licenses/>.*/(function() {'use strict';const SHORTS_SELECTOR = 'ytd-notification-renderer a[href*="/shorts/"]';const NOTIFICATIONS_CONTAINER = "ytd-notification-renderer";function removeShortsNotifications() {document.querySelectorAll(SHORTS_SELECTOR).forEach(link => {link.closest(NOTIFICATIONS_CONTAINER)?.remove();});}const observer = new MutationObserver(mutations => {mutations.forEach(mutation => {mutation.addedNodes.forEach(node => {if (node.nodeType === 1 && node.matches(NOTIFICATIONS_CONTAINER)) {removeShortsNotifications();}});});});function startObserver() {const container = document.querySelector("#notifications");if (container) {observer.observe(container, { childList: true, subtree: true });removeShortsNotifications();}else {setTimeout(startObserver, 500);}}startObserver();setInterval(removeShortsNotifications, 3000);})();