Outlook Web App Title Bar

If you've used the Outlook Web App in the past, you were likely unimpressed.  I was.  Until the latest version (number 14), that is.  It's not GMail, but it's absolutely above the "usable" threshold, which is awesome.  And I might add that I'm using it in Firefox on Linux – not Microsoft's favorite platform.  However, it does have one major usability issue: you can't see how many unread messages you have in your inbox without opening the window.  But fortunately, through the magic of GreaseMonkey, that's easy to fix:

// ==UserScript==
// @name           Outlook Web App More Gooderer
// @namespace      owa.barneyb.com
// @include        https://*/owa/
// @include        http://*/owa/
// ==/UserScript==

(function() {
  var originalTitle = unsafeWindow.document.title
  var f = function() {
    var ss = unsafeWindow.document.getElementsByTagName('span')
    for (var i = 0, l = ss.length; i < l; i++) {
      if (ss[i].getAttribute('fldrnm') == 'Inbox') { // 'Unread Mail' is also reasonable
        var children = ss[i].parentNode.childNodes
        var count = 0
        if (children.length == 2) {
          count = children[1].childNodes[1].innerHTML
        }
        unsafeWindow.document.title = 'Outlook ' + (count == 0 ? '' : '(' + count + ')')
          + ' - ' + originalTitle.split('-')[0]
        break
      }
    }
  }
  setInterval(f, 15 * 1000)
  f()
})()

Just drop that into a new user script, ensure the @include directives will match your OWA endpoint, and reload.  Now when the app loads it'll tweak your titlebar to put the useful info (unread message count) in there over to the left and move the useless information (your own name) over to the right.  Much better.  It'll also redo the same check every 15 seconds, so your title bar stays up to date while the window is minimized.  YAY!

Is this the most elegant solution to this problem?  No. Is it even an elegant solution?  Probably not.  Does it work and remain unintrusive?  Absolutely.  If you want to help with the first consideration, drop me a line.  In particular, some sort of event-driven approach would be far better so you don't have to wait for the 15 seconds to elapse before changes are reflected in the title bar.  If you're like me, you probably don't care enough to dig into it to that level, but if you have the time/knowledge/desire, please drop me a line.

3 responses to “Outlook Web App Title Bar”

  1. Richard

    Thank you very much for this useful tip! I use an adapted version of the script for my own OWA every day. :-)

    For the German version of OWA,

    if (ss[i].getAttribute('fldrnm') == 'Inbox') {

    should be amended to

    if (ss[i].getAttribute('fldrnm') == 'Posteingang') {

  2. jim

    anyone to implement htis into IE?

  3. chetan

    Please let me know the steps to run the script on ubuntu ….