annotate youtube-no-shorts.user.js @ 96:368035f2213b

Use builtin framework for document ready
author nanaya <me@nanaya.net>
date Fri, 23 Dec 2022 19:14:04 +0900
parents 5510cbaabcac
children 2c4470b73ad9
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
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
12 // Source: https://gist.github.com/Ultrawipf/7af006d1b8f75eddd3222d1053c3a243
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
13 (function () {
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
14 'use strict'
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
15 // From https://www.youtube.com/shorts/xxxx to https://www.youtube.com/watch?v=xxxx
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
16
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
17 window.location = window.location.href.replace('youtube.com/shorts/', 'youtube.com/watch?v=')
5510cbaabcac Add youtube shorts redirector
nanaya <me@nanaya.pro>
parents:
diff changeset
18 })()