Advertisement
Guest User

FF Greasemonkey - OWA Highlight Tab

a guest
Feb 15th, 2012
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name           OWA Tab Highlight On New Mail
  3. // @namespace      
  4. // @description    Highlights OWA tab after receiving new unread email (like gmail)
  5. // @include        https://your-owa-server.com/owa/?mod*
  6. // ==/UserScript==
  7.  
  8. // Times in seconds
  9. var refreshTime = 5;
  10. var firstLoadWaitTime = 3;
  11.  
  12. function check_unread () {
  13.         // normal message has class="c3"
  14.         // unread message has class="c3 ur"
  15.     unread = document.getElementsByClassName("c3 ur").length;
  16.     if (unread > 0) {
  17.         // Title change causes FF to highlight the tab
  18.         parent.document.title = "("+unread+") Inbox";
  19.     }
  20.  
  21.     // Pause per refreshTime then check again
  22.     var tm = setTimeout(check_unread, refreshTime*1000);
  23. }
  24.  
  25. var tm = setTimeout(check_unread, firstLoadWaitTime*1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement