您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Watch a YouTube Shorts video in the normal YouTube player
// ==UserScript== // @name Unshort YouTube // @namespace http://tampermonkey.net/ // @version 0.1 // @description Watch a YouTube Shorts video in the normal YouTube player // @author [email protected] // @match https://www.youtube.com/shorts/* // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com // @grant none // @license MIT // ==/UserScript== 'use strict'; var containerObserver = new MutationObserver(function() { var container_contents = document.querySelector("#center"); if (container_contents !== null) { var unshort_button = document.querySelector("#unshort-button"); if (unshort_button === null) { var new_button = document.createElement("button"); new_button.setAttribute("id", "unshort-button"); new_button.setAttribute("style", "color: var(--yt-spec-text-primary); background-color: var(--yt-spec-white-3); border-radius: 18em; padding-top: 10px; padding-bottom: 10px; padding-left: 12px; padding-right: 12px; margin: 5px; border-width: 0px; cursor: pointer; "); new_button.setAttribute("aria-label", "Unshort the video"); new_button.setAttribute("title", "Unshort the video"); new_button.setAttribute("onclick", "(function() {var new_url = document.URL.replace('/shorts/', '/watch?v='); window.location.href = new_url;})();"); new_button.innerText = "Unshort"; container_contents.appendChild(new_button); } } }); containerObserver.observe(document, { subtree: true, childList: true });