您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds an unread count favicon
// ==UserScript== // @name Outlook Web App Unread Count Favicon // @namespace http://mattstow.com // @version 0.1 // @description Adds an unread count favicon // @author Matt Stow // @match https://outlook.office365.com/mail/* // @match https://outlook.live.com/mail/* // @grant none // ==/UserScript== (function () { 'use strict'; if (window.top !== window.self) { return; } var faviconEl = document.querySelector('[rel="shortcut icon"]'); function setUnreadIconOnLoad (el) { var unreadEl = el.querySelector('.screenReaderOnly'); var count = unreadEl ? unreadEl.parentElement.textContent.replace('unread', '') : 'O'; faviconEl.href = 'https://dummyimage.com/32x32/0072c6/fff.png&text=' + count; } function setUreadIconOnChange (el) { var replacedUnread = el.textContent.replace('unread', ''); var count = replacedUnread ? replacedUnread : 'O'; faviconEl.href = 'https://dummyimage.com/32x32/0072c6/fff.png&text=' + count; } setTimeout(function () { var inboxEl = document.querySelector('[title="Inbox"]'); var unreadConfig = { characterData: true, childList: true, subtree: true }; var faviconConfig = { attributeFilter: ['href'] }; var unreadObserver = new MutationObserver(function (mutations) { setUreadIconOnChange(mutations[0].target); }); var faviconObserver = new MutationObserver(function (mutations) { mutations.forEach(function (mutation) { if (!mutation.target.href.includes('dummyimage.com')) { setUnreadIconOnLoad(inboxEl); } }); }); setUnreadIconOnLoad(inboxEl); unreadObserver.observe(inboxEl, unreadConfig); faviconObserver.observe(faviconEl, faviconConfig); }, 2000); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址