Last active
February 6, 2026 09:16
-
-
Save msanders/ee774a1e4867911bb70ec7389bdbc9e8 to your computer and use it in GitHub Desktop.
Revisions
-
msanders revised this gist
May 18, 2024 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,8 +8,8 @@ // @match https://www.youtube.com/* // @match https://m.youtube.com/* // @run-at document-start // @downloadURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js // @updateURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js // ==/UserScript== // Tested on Firefox Greasemonkey and Violentmonkey, and Safari Userscripts. -
msanders revised this gist
May 18, 2024 . 2 changed files with 39 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,9 +12,17 @@ To install, open the [raw link](https://gist.githubusercontent.com/msanders/ee77 ## Also see - [YouTube Neuter - noshorts](https://raw.githubusercontent.com/mchangrh/yt-neuter/main/filters/noshorts.txt) ([yt-neuter](https://neuter.mchang.xyz)) - [DeArrow - A Browser Extension for Better Titles and Thumbnails](https://dearrow.ajay.app/) Alternative/supplementary [Redirector](https://einaregilsson.com/redirector/) rule for short auto-looping: - **Example URL:** `https://www.youtube.com/shorts/example` - **Include pattern:** `^https?://(?:www\.)?youtube\.com/shorts/([\w-]+.*)$` - **Redirect to:** `https://www.youtube.com/watch?v=$1` - **Pattern type:** Regular Expression - **Description:** Use default video player for YouTube shorts ## License This is made available under the terms of the MIT license. For a copy, see https://opensource.org/licenses/MIT. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,24 +3,38 @@ // @description Disable frequently mistyped shortcuts (e.g. 0-9 number keys) and auto-looping on shorts. // @license MIT // @icon https://m.youtube.com/static/apple-touch-icon-114x114-precomposed.png // @namespace michaelsande.rs // @version 2024.05.17 // @match https://www.youtube.com/* // @match https://m.youtube.com/* // @run-at document-start // @downloadURL https://update.greasyfork.org/scripts/491283/YouTube%20Usability.user.js // @updateURL https://update.greasyfork.org/scripts/491283/YouTube%20Usability.meta.js // ==/UserScript== // Tested on Firefox Greasemonkey and Violentmonkey, and Safari Userscripts. (() => { "use strict"; const IS_MOBILE = document.location.hostname.startsWith("m."); const beforeLoad = () => { const ALLOWED_MODIFIER_KEYS = ["Alt", "Control", "Meta", "OS"]; const DISABLED_KEYS = new Set([ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "k", "j", "l", "Home", "End", ]); window.addEventListener( "keydown", event => { @@ -39,19 +53,21 @@ }; const afterLoad = () => { const container = document.getElementById( IS_MOBILE ? "player-shorts-container" : "page-manager" ); if (container !== null) { const disableShortLooping = () => { container .querySelector(IS_MOBILE ? "video" : "#shorts-player video") ?.removeAttribute("loop"); }; disableShortLooping(); // Shorts video element gets inserted dynamically by YouTube when // navigating, so can't be used as target. new MutationObserver(disableShortLooping).observe(container, { attributeFilter: ["loop"], childList: true, subtree: true, -
msanders revised this gist
Apr 14, 2024 . 1 changed file with 10 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,13 +6,13 @@ // @downloadURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js // @updateURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js // @namespace michaelsande.rs // @version 2024.04.14 // @match https://www.youtube.com/* // @match https://m.youtube.com/* // @run-at document-start // ==/UserScript== // Tested on Firefox Greasemonkey and Violentmonkey, and Safari Userscripts. (() => { "use strict"; const beforeLoad = () => { @@ -39,16 +39,19 @@ }; const afterLoad = () => { const pageManager = document.getElementById("page-manager"); if (pageManager !== null) { const disableShortLooping = () => { pageManager .querySelector("#shorts-player video") ?.removeAttribute("loop"); }; disableShortLooping(); // Shorts player gets inserted dynamically by YouTube when navigating, so // can't be used as target. new MutationObserver(disableShortLooping).observe(pageManager, { attributeFilter: ["loop"], childList: true, subtree: true, -
msanders revised this gist
Apr 13, 2024 . 1 changed file with 15 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,12 @@ // ==UserScript== // @name YouTube Usability // @description Disable frequently mistyped shortcuts (e.g. 0-9 number keys) and auto-looping on shorts. // @license MIT // @icon https://m.youtube.com/static/apple-touch-icon-114x114-precomposed.png // @downloadURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js // @updateURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js // @namespace michaelsande.rs // @version 2024.04.12 // @match https://www.youtube.com/* // @match https://m.youtube.com/* // @run-at document-start @@ -17,7 +17,9 @@ "use strict"; const beforeLoad = () => { const ALLOWED_MODIFIER_KEYS = ["Alt", "Control", "Meta", "OS"]; const DISABLED_KEYS = new Set( "0123456789kjl".split("").concat(["Home", "End"]) ); window.addEventListener( "keydown", @@ -33,25 +35,23 @@ true ); window.addEventListener("load", afterLoad); }; const afterLoad = () => { const shortsPlayer = document.getElementById("shorts-player"); if (shortsPlayer !== null) { const disableShortLooping = () => { shortsPlayer.querySelector("video")?.removeAttribute("loop"); }; disableShortLooping(); // Shorts video element gets replaced by YouTube so can't be used as MutationObserver target. new MutationObserver(disableShortLooping).observe(shortsPlayer, { attributeFilter: ["loop"], childList: true, subtree: true, }); } }; -
msanders revised this gist
Apr 11, 2024 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ // @downloadURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js // @updateURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js // @namespace michaelsande.rs // @version 2024.04.11 // @match https://www.youtube.com/* // @match https://m.youtube.com/* // @run-at document-start @@ -17,9 +17,7 @@ "use strict"; const beforeLoad = () => { const ALLOWED_MODIFIER_KEYS = ["Alt", "Control", "Meta", "OS"]; const DISABLED_KEYS = new Set("0123456789kjl".split("").concat(["Home", "End"])); window.addEventListener( "keydown", @@ -51,7 +49,9 @@ disableShortLooping(); new MutationObserver(disableShortLooping).observe(shortsPlayerVideo, { attributeFilter: [ "loop" ] }); } }; -
msanders revised this gist
Apr 10, 2024 . 1 changed file with 14 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ // @downloadURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js // @updateURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js // @namespace michaelsande.rs // @version 2024.04.10 // @match https://www.youtube.com/* // @match https://m.youtube.com/* // @run-at document-start @@ -17,7 +17,9 @@ "use strict"; const beforeLoad = () => { const ALLOWED_MODIFIER_KEYS = ["Alt", "Control", "Meta", "OS"]; const DISABLED_KEYS = new Set( "0123456789kjl".split("").concat(["Home", "End"]) ); window.addEventListener( "keydown", @@ -41,16 +43,17 @@ }; const afterLoad = () => { const shortsPlayerVideo = document.querySelector("#shorts-player video"); if (shortsPlayerVideo !== null) { const disableShortLooping = () => { shortsPlayerVideo.removeAttribute("loop"); }; disableShortLooping(); new MutationObserver(disableShortLooping).observe(shortsPlayerVideo, { attributes: true, }); } }; beforeLoad(); -
msanders revised this gist
Apr 1, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ // ==UserScript== // @name YouTube Usability // @description Disable frequently mistyped shortcuts (e.g. 0-9 number keys) and auto-looping on shorts. // @license MIT // @icon https://m.youtube.com/static/apple-touch-icon-114x114-precomposed.png // @downloadURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js -
msanders revised this gist
Mar 31, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ // ==UserScript== // @name YouTube Usability // @description Disables frequently mistyped shortcuts (e.g. 0-9 number keybindings) and auto-looping on shorts. // @license MIT // @icon https://m.youtube.com/static/apple-touch-icon-114x114-precomposed.png // @downloadURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js -
msanders revised this gist
Mar 31, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ ## Userscript: YouTube usability improvements Short userscript that disables frequently mistyped shortcuts (e.g. 0-9 number keybindings) and auto-looping on shorts. Also available on [GreasyFork](https://greasyfork.org/en/scripts/491283-youtube-usability). -
msanders revised this gist
Mar 30, 2024 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,8 @@ Short userscript that disables frequently mistyped shortcuts (e.g. 0-9) and auto-looping on shorts. Also available on [GreasyFork](https://greasyfork.org/en/scripts/491283-youtube-usability). ## Installation To install, open the [raw link](https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js) and follow the prompt on the [Userscripts](https://github.com/quoid/userscripts?tab=readme-ov-file#installation), [Violentmonkey](https://violentmonkey.github.io/get-it/), or [Greasemonkey](https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/) extension modal. Alternatively, you can create a new JavaScript item on the extension page and copy/paste the script. On iOS, go to the same link and tap the puzzle icon in the address bar and then the “Userscripts” menu item. -
msanders revised this gist
Mar 30, 2024 . 2 changed files with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ ## Userscript: YouTube usability improvements Short userscript that disables frequently mistyped shortcuts (e.g. 0-9) and auto-looping on shorts. ## Installation This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,12 @@ // ==UserScript== // @name YouTube Usability // @description Disables frequently mistyped shortcuts (e.g. 0-9) and auto-looping on shorts. // @license MIT // @icon https://m.youtube.com/static/apple-touch-icon-114x114-precomposed.png // @downloadURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js // @updateURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js // @namespace michaelsande.rs // @version 2024.03.30 // @match https://www.youtube.com/* // @match https://m.youtube.com/* // @run-at document-start -
msanders revised this gist
Mar 30, 2024 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ ## Userscript: YouTube usability improvements Disables frequently mistyped shortcuts (e.g. 0-9) and auto-looping on shorts. ## Installation -
msanders revised this gist
Mar 30, 2024 . 2 changed files with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ Disables frequently mistyped shortcuts (e.g. 0-9) and auto-looping on shorts. ## Installation To install, open the [raw link](https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js) and follow the prompt on the [Userscripts](https://github.com/quoid/userscripts?tab=readme-ov-file#installation), [Violentmonkey](https://violentmonkey.github.io/get-it/), or [Greasemonkey](https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/) extension modal. Alternatively, you can create a new JavaScript item on the extension page and copy/paste the script. On iOS, go to the same link and tap the puzzle icon in the address bar and then the “Userscripts” menu item. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ // ==UserScript== // @name YouTube Usability // @description Disables frequently mistyped shortcuts (e.g. 0-9) and auto-looping on shorts. // @icon https://m.youtube.com/static/apple-touch-icon-114x114-precomposed.png // @downloadURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js // @updateURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js -
msanders revised this gist
Mar 30, 2024 . 2 changed files with 14 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,14 @@ ## Installation To install, open the [raw link](https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js) and follow the prompt on the [Userscripts](https://github.com/quoid/userscripts?tab=readme-ov-file#installation), [Violentmonkey](https://violentmonkey.github.io/get-it/), or [Greasemonkey](https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/) extension modal. Alternatively, you can create a new JavaScript item on the extension page and copy/paste the script. On iOS, go to the same link and tap the puzzle icon in the address bar and then the “Userscripts” menu item. <img width="790" alt="Screenshot 2023-09-06" src="https://user-images.githubusercontent.com/54970/265988148-413333b9-5c4f-45c0-96d9-bc2d7b906140.png"> ## Also see - [YouTube: filter out Shorts](https://letsblock.it/filters/youtube-shorts) - [DeArrow - A Browser Extension for Better Titles and Thumbnails](https://dearrow.ajay.app/) ## License This is made available under the terms of the MIT license. For a copy, see https://opensource.org/licenses/MIT. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,8 @@ // @name YouTube Usability // @description Disable frequently mistyped shortcuts and auto-looping on shorts. // @icon https://m.youtube.com/static/apple-touch-icon-114x114-precomposed.png // @downloadURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js // @updateURL https://gist.githubusercontent.com/msanders/ee774a1e4867911bb70ec7389bdbc9e8/raw/youtube-ux.user.js // @match https://www.youtube.com/* // @match https://m.youtube.com/* // @run-at document-start -
msanders created this gist
Mar 30, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ Also see: - [YouTube: filter out Shorts](https://letsblock.it/filters/youtube-shorts) - [DeArrow - A Browser Extension for Better Titles and Thumbnails](https://dearrow.ajay.app/) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ // ==UserScript== // @name YouTube Usability // @description Disable frequently mistyped shortcuts and auto-looping on shorts. // @icon https://m.youtube.com/static/apple-touch-icon-114x114-precomposed.png // @match https://www.youtube.com/* // @match https://m.youtube.com/* // @run-at document-start // ==/UserScript== // Tested on Greasemonkey and Violentmonkey for Firefox, and Userscripts for Safari. (() => { "use strict"; const beforeLoad = () => { const ALLOWED_MODIFIER_KEYS = ["Alt", "Control", "Meta", "OS"]; const DISABLED_KEYS = new Set("0123456789kjl".split("").concat(["Home", "End"])); window.addEventListener( "keydown", event => { if ( DISABLED_KEYS.has(event.key) && !ALLOWED_MODIFIER_KEYS.some(event.getModifierState.bind(event)) && !event.isComposing ) { event.stopImmediatePropagation(); } }, true ); if (document.readyState === "complete") { afterLoad(); } else { window.addEventListener("load", afterLoad); } }; const afterLoad = () => { disableShortLooping(); new MutationObserver(disableShortLooping).observe(document, { attributes: false, childList: true, subtree: true, }); }; const disableShortLooping = () => { document.querySelector("#shorts-player video")?.removeAttribute("loop"); }; beforeLoad(); })();