您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Point YouTube links to Invidio -- and Twitter links to Nitter
当前为
// ==UserScript== // @name YT2Invidio // @namespace http://projects.izzysoft.de/ // @author IzzySoft // @description Point YouTube links to Invidio -- and Twitter links to Nitter // @license CC BY-NC-SA // @include * // @version 1.1.2 // @run-at document-idle // @grant unsafeWindow // @homepageURL https://codeberg.org/izzy/userscripts // ==/UserScript== // Define your preferred instance here. // A list of available instances can be found at // https://github.com/omarroth/invidious/wiki/Invidious-Instances videohost='invidious.snopyta.org'; for(var i = 0; i < document.links.length; i++) { var elem = document.links[i]; // Youtube: https://www.youtube.com/watch?v=cRRA2xRRgl8 || https://www.youtube.com/channel/dfqwfhqQ34er // only rewrite if we're not on Invidious already (too keep the "watch this on YouTube" links intact) if (elem.href.match(/(www\.)?youtube.com(\/watch\?v=[a-z0-9_-]+)/i) || elem.href.match(/(www\.)?youtube.com(\/channel\/[a-z0-9_-]+)/i)) { if (location.hostname != videohost) { elem.href='https://'+videohost+RegExp.$2; } } else if (elem.href.match(/(www\.)?youtu.be\/([a-z0-9_-]+)/i)) { if (location.hostname != videohost) { elem.href='https://'+videohost+'/watch?v='+RegExp.$2; } // Twitter } else if (elem.href.match(/(mobile\.)?twitter\.com\/([^&#]+)/i)) { elem.href='https://nitter.net/'+RegExp.$2; } }