您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
View a rip on the SiIvaGunner Wiki in one click!
// ==UserScript== // @name To SiIvaGunner Wiki // @namespace https://greasyfork.org/users/1201646 // @version 1.0.2 // @description View a rip on the SiIvaGunner Wiki in one click! // @author lemocha // @match https://www.youtube.com/* // @icon https://static.wikia.nocookie.net/siivagunner/images/4/4a/Site-favicon.ico // @grant GM_registerMenuCommand // @run-at document-idle // @license MIT // ==/UserScript== (() => { "use strict"; // register menu command GM_registerMenuCommand("To SiIva Wiki", () => redirect("https://siivagunner.fandom.com/wiki/")); function redirect(url) { // get rip title based on youtube document title let title = document.title.split(" - YouTube")[0]; // remove notification count in document title if present if (title.charAt(0) === "(" && /[0-9]/.test(title.charAt(1))) { title = title.slice(title.indexOf(") ") + 2); } // replace certain characters so link is URL safe title = title.replaceAll("?", "%3F"); title = title.replaceAll(" ", "_"); title = title.replaceAll("[", "("); title = title.replaceAll("]", ")"); title = title.replaceAll("#", ""); // open wiki page in new tab const a = document.createElement("a"); a.href = url + title; a.target = "_blank"; a.click(); } })();