Redirect-Shorts

Redirect to watch page

目前为 2023-05-04 提交的版本。查看 最新版本

// ==UserScript==
// @name        Redirect-Shorts
// @namespace   https://github.com/sapondanaisriwan/anti-shorts
// @match       https://www.youtube.com/*
// @grant       none
// @version     1.0.2
// @author      sapondanaisriwan
// @description Redirect to watch page
// @license      MIT
// @run-at      document-start
// @icon        https://user-images.githubusercontent.com/64634605/235854015-81c5986d-b858-4f64-b14c-93bba56ba265.png
// ==/UserScript==

"use strict";

function redirectToWatchPage() {
  const { origin, pathname } = location;
  const isShorts = pathname.startsWith("/shorts/");
  const newURL = `${origin}${pathname.replace("shorts", "watch")}`;
  isShorts && location.replace(newURL);
}

function run() {
  redirectToWatchPage();
  document.addEventListener("yt-navigate-start", redirectToWatchPage);
}

run();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址