// ==UserScript== // @name YouTube 伪装成 哔哩哔哩 // @namespace userElaina // @version 2022.10.24.1 // @description 中国人就用哔哩哔哩 // @author userElaina // @license MIT // @match *.youtube.com/* // @grant none // @downloadURL none // ==/UserScript== (function () { function sleep(time) { return new Promise((resolve) => setTimeout(resolve, time)); } var spl = window.location.href.split('/'); if (spl.length < 4 || (spl.length == 4 && spl[3].length == 0)) { document.title = "哔哩哔哩 (゜-゜)つロ 干杯~-bilibili"; } else { sleep(500).then(() => { document.title = document.title.replace(/\s-\sYouTube*/g, " - 哔哩哔哩"); }); } sleep(1000).then(() => { document.querySelector('link[rel="icon"]').href = 'https://raw.githubusercontent.com/userElaina/this-is-the-China-website/main/youtube/bilibili.ico'; document.querySelectorAll('div.ytp-play-progress.ytp-swatch-background-color').forEach(v => { v.style.backgroundColor = '#00aeec'; }); document.querySelector('div.ytp-scrubber-button.ytp-swatch-background-color').style.backgroundColor = '#00aeec'; var subButton = document.querySelector('tp-yt-paper-button.style-scope.ytd-subscribe-button-renderer'); if (subButton.getAttribute('subscribed') === null) { subButton.innerText = '关注'; subButton.style.color = '#ffffff'; subButton.style.backgroundColor = '#00aeec'; } else { subButton.innerText = '已关注'; // subButton.style.color = '#606060'; // subButton.style.backgroundColor = '#e9e9e9'; } document.querySelectorAll('[id=progress]').forEach(v => { v.style.backgroundColor = '#00aeec'; }); }); document.getElementById("logo-icon").innerHTML = ''; })();