From 10a670fe33bd7fab841ddaf4674deb11477f2267 Mon Sep 17 00:00:00 2001 From: Stephen Papierski Date: Tue, 22 Sep 2020 16:34:03 -0600 Subject: Changed gmail getMessages to grab value next to Inbox (changes with inbox type) instead of total messages in the traditional inbox. --- recipes/gmail/webview.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'recipes/gmail/webview.js') diff --git a/recipes/gmail/webview.js b/recipes/gmail/webview.js index 95d28e7..bc6e4a0 100644 --- a/recipes/gmail/webview.js +++ b/recipes/gmail/webview.js @@ -5,13 +5,13 @@ module.exports = (Franz) => { if (location.hostname == 'www.google.com' && location.href.includes("gmail/about/")) { location.href = 'https://accounts.google.com/AccountChooser?service=mail&continue=https://mail.google.com/mail/'; } - + const getMessages = function getMessages() { let count = 0; - if (document.getElementsByClassName('J-Ke n0').length > 0) { - if (document.getElementsByClassName('J-Ke n0')[0].getAttribute('aria-label') != null) { - count = parseInt(document.getElementsByClassName('J-Ke n0')[0].getAttribute('aria-label').replace(/[^0-9.]/g, ''), 10); + if (document.getElementsByClassName('bsU').length > 0) { + if (document.getElementsByClassName('bsU')[0].innerHTML != null) { + count = parseInt(document.getElementsByClassName('bsU')[0].innerHTML.trim(), 10); } } -- cgit v1.2.3-70-g09d2