您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
10/21/2023, 2:15:40 PM
// ==UserScript== // @name YouTube Alternative frontends // @namespace Violentmonkey Scripts // @match *://www.youtube.com/watch?v=* // @grant none // @version 1.1 // @author - // @description 10/21/2023, 2:15:40 PM // @require https://code.jquery.com/jquery-3.7.1.min.js // @run-at document-end // @license GPLv3 // ==/UserScript== setInterval( function() { let subButton = document.querySelector("#subscribe-button") let videoId = window.location.href; videoId = videoId.substring(videoId.search("=") + 1) let frontendLinks = [ ["Piped", "https://piped.video/watch?v=" + videoId], ["Invidious", "https://yewtu.be/watch?v=" + videoId] ]; let button; let youtubeButtonAttrs = 'class="yt-spec-button-shape-next yt-spec-button-shape-next--filled yt-spec-button-shape-next--mono yt-spec-button-shape-next--size-m" type="button" id="dropdownMenuButton" aria-haspopup="true" aria-expanded="false" style="padding: 10px; margin: 10px;"' for (let i = 0; i < frontendLinks.length; i++){ button = $("#" + frontendLinks[i][0]) if (button){ button.remove() } button = $( ` <div class="style-scope ytd-watch-metadata"id="${frontendLinks[i][0]}"> <button ${youtubeButtonAttrs}> <a href="${frontendLinks[i][1]}" target="_blank"> ${frontendLinks[i][0]} </a> </button> </div> ` ) subButton.parentNode.insertBefore(button[0], subButton); } }, 3000 )