gmail.js
gmail.js copied to clipboard
Update get.unread_inbox_emails to get a count
Problem
api.get.unread_inbox_emails is returning 0, when there are unread inbox emails.
(probably the same thing happening for all api.get.unread_emails() keys)
Detail
My left navigation looks like this:
The api.get.unread_emails() method is looking for a semicolon in the title:
573 if(dom[0].title.indexOf("(") !== -1) {
574 return parseInt(dom[0].title.split(":")[0].replace(/[^0-9]/g, ""));
575 }
My title doesn't have the email count or a semicolon in it:
Working replacement for my Gmail instance
parseInt(dom[0].attributes['aria-label'].value.replace(/[^0-9]/g, ""));
// instead of looking for the count in the title, look in the aria-label
That looks reasonable enough. Could you create a PR for that?