您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Redirects Youtube URLs to Invidio.us
当前为
// ==UserScript== // @description Redirects Youtube URLs to Invidio.us // @name Invidious Redirect // @namespace Backend // @include http://www.youtube.com/* // @include https://www.youtube.com/* // @version 0.1.0 // @run-at document-start // @grant none // ==/UserScript== function replace_beginning(str, beginning, replacement) { if (str.startsWith(beginning)) { return replacement + str.slice(beginning.length); } return str; } function urls_list(str) { return [str, "http://" + str, "https://" + str]; } function replace_yt(str) { yt_list = []; yt_list = yt_list.concat(urls_list("www.youtube.com/watch")); yt_list.forEach((b) => { str = replace_beginning(str, b, "https://invidio.us/watch"); }); return str; } let loc = window.location.href; loc = replace_yt(loc); if (window.location.href !== loc) { window.location.href = loc; }