您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Update the HTML title with the number of unread messages and notify of new messages
当前为
// ==UserScript== // @name Outlook OWA Notifier and Unread Title Updater // @version 0.3 // @description Update the HTML title with the number of unread messages and notify of new messages // @author Dan Moore // @match */owa/* // @grant none // @namespace https://greasyfork.org/users/40703 // ==/UserScript== (function() { Notification.requestPermission(); var $title = $('title'); var unreadCount = 0; setInterval(function() { var unread = $('[title=Inbox]').next().next().html(); var newUnreadCount = unreadCount; if (unread.length) { $title.html(unread + ' - Outlook'); newUnreadCount = parseInt(unread); } else { $title.html('Outlook'); newUnreadCount = 0; } if (newUnreadCount > unreadCount) { var summary = $("div[aria-label*='Unread'") .attr('aria-label') .replace('1 Unread, From ', '') .replace('Subject ', '') .replace('Files Attached, ', '') .replace('Last message ', '') .trim(); new Notification(summary); } unreadCount = newUnreadCount; }, 1000); })();