您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
YouTube shorts redirect / YouTube shorts redirect
// ==UserScript== // @name YouTube shorts redirect // @namespace http://tampermonkey.net/ // @version 0.3 // @author Fuim // @match *://*.youtube.com/* // @icon https://www.google.com/s2/favicons?domain=youtube.com // @grant none // @run-at document-start // @license GNU GPLv2 // @description YouTube shorts redirect / YouTube shorts redirect // ==/UserScript== (function () { 'use strict'; function redirect() { if (location.pathname.startsWith("/shorts")) { // 0 1 2 // /shorts/abcde123456 const videoId = location.pathname.split("/")[2]; const newUrl = "https://www.youtube.com/watch?v=" + videoId; window.location.replace(newUrl); } } // Run it normally once in case a youtube shorts url was opened directly redirect(); // Use this event so it'll work when navigating inside of youtube. // Otherwise, people have to refresh the page for it to work. // Some other events that might work? yt-page-data-updated, yt-page-type-changed, yt-navigate-finish document.addEventListener("yt-navigate-start", redirect); })();