├── LICENSE └── no-youtube-shorts.js /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Moritz Schmale 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /no-youtube-shorts.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name no youtube shorts 3 | // @namespace http://narrowtux.com/ 4 | // @version 0.4 5 | // @description Automatically redirects to the good youtube player with scrubber and without stupid overlays over half the video 6 | // @author narrowtux 7 | // @match https://www.youtube.com/* 8 | // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com 9 | // @grant none 10 | // ==/UserScript== 11 | 12 | (function() { 13 | 'use strict'; 14 | 15 | function checkUrl() { 16 | console.log("Checking for Shorts player...") 17 | let url = window.location.href; 18 | let videoId = url.match(/\/shorts\/([a-zA-Z0-9_\-]{11})(\?.*)?$/)[1] 19 | if (videoId) { 20 | console.log("Replacing old player", videoId) 21 | window.location.replace(`https://youtube.com/watch?v=${videoId}`) 22 | } 23 | 24 | 25 | } 26 | 27 | let ref; 28 | function removeShorts() { 29 | console.log("Removing shorts from subscriptions list ...") 30 | document.querySelectorAll("span#text.ytd-thumbnail-overlay-time-status-renderer[aria-label=Shorts]").forEach(el => { 31 | el.closest(".ytd-grid-renderer").remove() 32 | !!ref && clearInterval(ref); 33 | ref = null 34 | }) 35 | } 36 | ref = setInterval(removeShorts, 200) 37 | 38 | window.addEventListener("yt-page-data-updated", checkUrl) 39 | checkUrl() 40 | })(); 41 | --------------------------------------------------------------------------------