comparison youtube-no-shorts.user.js @ 109:ef21ef445fc6

Cleanups - wrap everything in function and call them last - fix namespace and update url
author nanaya <me@nanaya.net>
date Sun, 15 Jan 2023 23:33:41 +0900
parents 2c4470b73ad9
children d9dc190bccaf
comparison
equal deleted inserted replaced
108:2c4470b73ad9 109:ef21ef445fc6
7 // @icon https://upload.wikimedia.org/wikipedia/commons/thumb/f/fc/Youtube_shorts_icon.svg/193px-Youtube_shorts_icon.svg.png 7 // @icon https://upload.wikimedia.org/wikipedia/commons/thumb/f/fc/Youtube_shorts_icon.svg/193px-Youtube_shorts_icon.svg.png
8 // @grant none 8 // @grant none
9 // @run-at document-start 9 // @run-at document-start
10 // ==/UserScript== 10 // ==/UserScript==
11 11
12 'use strict';
13
12 // Source: https://gist.github.com/Ultrawipf/7af006d1b8f75eddd3222d1053c3a243 14 // Source: https://gist.github.com/Ultrawipf/7af006d1b8f75eddd3222d1053c3a243
13 (function () { 15 function shortDirect () {
14 'use strict';
15 // From https://www.youtube.com/shorts/xxxx to https://www.youtube.com/watch?v=xxxx 16 // From https://www.youtube.com/shorts/xxxx to https://www.youtube.com/watch?v=xxxx
17 window.location = window.location.href.replace('youtube.com/shorts/', 'youtube.com/watch?v=');
18 }
16 19
17 window.location = window.location.href.replace('youtube.com/shorts/', 'youtube.com/watch?v='); 20 shortDirect();
18 })();