Skip to content

Instantly share code, notes, and snippets.

@rpietzsch
Created August 14, 2016 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rpietzsch/99df681259c94999b74e0b5177aa3ff0 to your computer and use it in GitHub Desktop.
Save rpietzsch/99df681259c94999b74e0b5177aa3ff0 to your computer and use it in GitHub Desktop.
Show OWA unread notification in RAMBOX
@bundyo
Copy link

bundyo commented Jun 29, 2017

This should be more universal:

const originalTitle = document.title;

function checkUnread() {
    const unreadCount = +$("[title=Inbox]").first().next().next().text();

    if (unreadCount > 0) {
        return document.title = `(${unreadCount}) ${originalTitle}`;
    }

    if (document.title !== originalTitle) {
        document.title = originalTitle;
    }
}

setInterval(checkUnread, 3000);

@bundyo
Copy link

bundyo commented Jun 29, 2017

You can find better implementation in this repo, using mutation observers and web notifications on incoming mail.

https://github.com/bundyo/owa-rambox

@jaredthayer
Copy link

I've implemented this solution as well as a few other variations of the JS I found elsewhere and am still not getting notifications. A 2020 update would be much appreciated! I am a Mac user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment