您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Converts Youtube links to Invidio.us ones
当前为
// ==UserScript== // @name Invidious Teleporter // @namespace lousando // @match https://*/* // @match http://*/* // @exclude-match https://invidiou.site* // @grant GM_getValue // @run-at document-idle // @version 0.2 // @author Louis Sandoval // @description Converts Youtube links to Invidio.us ones // ==/UserScript== // allow for overriding of Invidious instance const invidiousDomain = GM_getValue("invidious_domain", "invidiou.site"); const convertYoutubeLinks = () => { const youtubeRegex = /youtu*.be(\.com)?/i; // links Array.from(document.body.querySelectorAll("a[href]")).filter(link => { return youtubeRegex.test(link.href); }).forEach(link => { link.innerText = link.innerText.replace(youtubeRegex, invidiousDomain); link.setAttribute("href", link.href.replace(youtubeRegex, invidiousDomain)); }); // iframes Array.from(document.body.querySelectorAll("iframe[src]")).filter(iframe => { return youtubeRegex.test(iframe.src); }).forEach(iframe => { iframe.setAttribute("src", iframe.src.replace(youtubeRegex, invidiousDomain)); }); }; // Create an observer instance linked to the callback function const observer = new MutationObserver(convertYoutubeLinks); convertYoutubeLinks(); // Start observing the target node for configured mutations observer.observe(document, { childList: true, subtree: true });
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址