您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Fix Bilibili favicon issue by replacing the broken link with a working one.
// ==UserScript== // @name Bilibili Favicon Fix // @namespace http://tampermonkey.net/ // @version 0.2 // @description Fix Bilibili favicon issue by replacing the broken link with a working one. // @author Your Name // @match *://*.bilibili.com/* // @icon https://www.google.com/s2/favicons?domain=bilibili.com // @grant none // ==/UserScript== (function() { 'use strict'; const newFaviconUrl = 'https://static.hdslb.com/images/favicon.ico'; function replaceFavicon() { const linkElements = document.querySelectorAll("link[rel='shortcut icon']"); linkElements.forEach(link => { if (link.href.includes('www.bilibili.com/favicon.ico')) { link.href = newFaviconUrl; } }); // If no favicon link is found, create a new one if (linkElements.length === 0) { const newLink = document.createElement('link'); newLink.rel = 'shortcut icon'; newLink.href = newFaviconUrl; document.head.appendChild(newLink); } } // Execute the function to replace the favicon after the page fully loads window.addEventListener('load', replaceFavicon); })();