您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a button to redirect from YouTube to an Invidious instance
当前为
- // ==UserScript==
- // @name YouTube To Invidious Button
- // @version 1.0
- // @description Adds a button to redirect from YouTube to an Invidious instance
- // @author Rust1667
- // @match *://www.youtube.com/*
- // @namespace https://greasyfork.org/users/980489
- // ==/UserScript==
- (function() {
- 'use strict';
- const invInstances = [
- 'redirect.invidious.io',
- 'inv.nadeko.net',
- 'invidious.nerdvpn.de',
- 'invidious.privacyredirect.com',
- 'invidious.jing.rocks',
- ];
- const invInstance = invInstances[Math.floor(Math.random() * invInstances.length)];
- var button = document.createElement('button');
- button.innerHTML = 'Redirect to Invidious';
- button.style.position = 'fixed';
- button.style.top = '10px';
- button.style.right = '300px';
- button.style.zIndex = '10000';
- button.style.padding = '10px';
- button.style.backgroundColor = '#ff0000';
- button.style.color = '#ffffff';
- button.style.border = 'none';
- button.style.borderRadius = '5px';
- button.style.cursor = 'pointer';
- document.body.appendChild(button);
- button.onclick = function () {
- window.location.assign(window.location.toString().replace('www.youtube.com', invInstance));
- };
- })();