您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Don't let Twitter put a red dot on its Favicon just because you got a little notification
// ==UserScript== // @name Twitter Favicon No Red Notifcation Dot // @namespace https://gf.qytechs.cn/en/users/8615-joeytwiddle // @version 0.1 // @license ISC // @description Don't let Twitter put a red dot on its Favicon just because you got a little notification // @author joeytwiddle // @match https://twitter.com/* // @grant none // ==/UserScript== // TODO: Option to allow the red dot IFF the user has pending messages (but not if they have pending notifications) (function () { 'use strict'; const debugLogging = false; const head = document.getElementsByTagName('head')[0]; function checkTheFavicon() { debugLogging && console.log('Checking favicon...'); const currentIcons = head.querySelectorAll('[rel="shortcut icon"]'); debugLogging && Array.from(currentIcons).forEach(icon => console.log('icon:', icon.href)); const currentIcon = currentIcons[currentIcons.length - 1]; if (!currentIcon) { console.warn('Twitter_Favicon_No_Red_Notification_Dot: No currentIcon to check'); return; } if (currentIcon.href.includes('twitter-pip')) { debugLogging && console.log('Unwanted pip icon detected. Exterminate!'); setFavicon(currentIcon, false); } } function setFavicon(currentIcon, withPip) { // Create an entirely new element /* const newIcon = document.createElement('link'); newIcon.setAttribute('rel', 'shortcut icon'); //newIcon.setAttribute('type', 'image/x-icon'); //newIcon.setAttribute('href', 'data:image/x-icon;base64,______'); newIcon.setAttribute('href', 'https://abs.twimg.com/favicons/twitter.ico'); for (let i = currentIcons.length; i--;) { currentIcons[i].parentNode.removeChild(currentIcons[i]); } head.appendChild(newIcon); */ // Reuse the existing element currentIcon.setAttribute('href', 'https://abs.twimg.com/favicons/twitter.ico'); } checkTheFavicon(); new MutationObserver(mutations => checkTheFavicon()).observe(head, { childList: true, subtree: true }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址