您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Cleans YouTube Links
// ==UserScript== // @name Clean YouTube Links // @version 0 // @namespace cleanytsi // @description Cleans YouTube Links // @author (me) // @match *://8chan.moe/*/res/* // @match *://8chan.se/*/res/* // @match *://8chan.cc/*/res/* // @run-at document-idle // @grant none // ==/UserScript== (function() { "use strict"; const target = document.getElementById("threadList"); const observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { document.querySelectorAll('.divMessage a:not(.quoteLink)').forEach((link) => { if(link.href.includes("youtu") && link.href.includes("si=")) { let stringindex = link.href.indexOf("si=") let sanitized = link.href.split(link.href.substring(stringindex, stringindex+19)).join("") if(sanitized.substring(sanitized.length-1) == "?") { sanitized = sanitized.slice(0, sanitized.length-1) } if(sanitized.includes("?&")) { sanitized = sanitized.split("?&").join("?") } link.textContent = sanitized link.href = sanitized } }); }); }); const config = { subtree: true, childList: true }; observer.observe(target, config); })();