annotate youtube-no-shorts.user.js @ 111:055f5d084706

Fix metadata and reset version
author nanaya <me@nanaya.net>
date Sun, 15 Jan 2023 23:37:14 +0900
parents ef21ef445fc6
children d9dc190bccaf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
93
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
1 // ==UserScript==
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
2 // @name Youtube shorts redirector
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
3 // @version 0.1
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
4 // @description Redirects all youtube shorts videos to normal video pages
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
5 // @author Ultrawipf
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
6 // @match https://*.youtube.com/shorts/*
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
7 // @icon https://upload.wikimedia.org/wikipedia/commons/thumb/f/fc/Youtube_shorts_icon.svg/193px-Youtube_shorts_icon.svg.png
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
8 // @grant none
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
9 // @run-at document-start
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
10 // ==/UserScript==
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
11
109
ef21ef445fc6 Cleanups
nanaya <me@nanaya.net>
parents: 108
diff changeset
12 'use strict';
ef21ef445fc6 Cleanups
nanaya <me@nanaya.net>
parents: 108
diff changeset
13
93
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
14 // Source: https://gist.github.com/Ultrawipf/7af006d1b8f75eddd3222d1053c3a243
109
ef21ef445fc6 Cleanups
nanaya <me@nanaya.net>
parents: 108
diff changeset
15 function shortDirect () {
93
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
16 // From https://www.youtube.com/shorts/xxxx to https://www.youtube.com/watch?v=xxxx
109
ef21ef445fc6 Cleanups
nanaya <me@nanaya.net>
parents: 108
diff changeset
17 window.location = window.location.href.replace('youtube.com/shorts/', 'youtube.com/watch?v=');
ef21ef445fc6 Cleanups
nanaya <me@nanaya.net>
parents: 108
diff changeset
18 }
93
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
19
109
ef21ef445fc6 Cleanups
nanaya <me@nanaya.net>
parents: 108
diff changeset
20 shortDirect();