Below is a simple UserScript (install with TamperMonkey or GreaseMonkey) to refresh the light OWA page and set the title of the page (tab) to the number of unread emails. I’ve only tried this in the light OWA mode 2010, but it seems to do the job, and refreshes the page once a minute.
I wrote this as I spend 95% of my day at work on my Linux box, and didn’t feel like having to run a full Exchange-to-imap gateway (like DavMail) so I just use the lightweight Outlook mail in a tab. Just be careful when composing an email using the light mode as it’ll just refresh the page regardless…!
// ==UserScript== // @name Outlook Web Access Light Title Inbox Count // @namespace seb.so // @author Seb Maynard // @version 0.1 // @include https://*/owa/* // @include http://*/owa/* // ==/UserScript== (function() { var originalTitle = unsafeWindow.document.title; var setTitleFunc = function(title) { title = title.replace(/\(/g, "").replace(/\)/g, ""); window.document.title = title; }; var f = function() { var setTitle = false; var as = unsafeWindow.document.getElementsByTagName('a'); for (var i = 0, l = as.length; i < l; i++) { if (as[i].getAttribute('title') == 'Inbox') { var unrd = as[i].nextSibling; if (unrd && unrd.className == "unrd") { setTitleFunc(unrd.innerHTML + " new"); setTitle = true; } } } if (!setTitle) setTitleFunc("- "); }; setInterval("window.location=window.location", 60 * 1000); f(); })();
Leave a Reply