diff 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
line wrap: on
line diff
--- a/youtube-no-shorts.user.js	Sun Jan 15 23:24:03 2023 +0900
+++ b/youtube-no-shorts.user.js	Sun Jan 15 23:33:41 2023 +0900
@@ -9,10 +9,12 @@
 // @run-at       document-start
 // ==/UserScript==
 
+'use strict';
+
 // Source: https://gist.github.com/Ultrawipf/7af006d1b8f75eddd3222d1053c3a243
-(function () {
-  'use strict';
+function shortDirect () {
   // From https://www.youtube.com/shorts/xxxx to https://www.youtube.com/watch?v=xxxx
+  window.location = window.location.href.replace('youtube.com/shorts/', 'youtube.com/watch?v=');
+}
 
-  window.location = window.location.href.replace('youtube.com/shorts/', 'youtube.com/watch?v=');
-})();
+shortDirect();