您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Send desktop notification from Outlook Web Application
// ==UserScript== // @name Outlook Notification // @namespace http://tampermonkey.net/ // @version 0.4 // @description Send desktop notification from Outlook Web Application // @author Wenxuan Zhao // @match https://outlook.office.com/mail/inbox // @iconURL http://ow2.res.office365.com/owamail/2019031801.04/resources/images/favicons/mail-seen.ico // @grant GM_notification // ==/UserScript== (function() { 'use strict'; var sentSet = new Set(); console.log('[Outlook Notification] UserScript loaded') setInterval(function () { var reminders = Array.from(document.querySelector('.ms-Layer').firstChild.firstChild.lastChild.lastChild.firstChild.children) reminders.forEach(function (reminder) { if (sentSet.has(reminder)) return; sentSet.add(reminder) var event = reminder.querySelector('.ms-Button-flexContainer').lastChild var message = event.firstChild.firstChild.textContent var time = event.lastChild.firstChild.textContent var location = event.lastChild.lastChild.textContent var title = 'Outlook Notification' var text = message + " / " + time + " @ " + location console.log('[Outlook Notification] Send notification: ', message, time, location) GM_notification(text, title, 'http://ow2.res.office365.com/owamail/2019031801.04/resources/images/favicons/mail-seen.ico') }) }, 1000); })();