aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/office365-owa/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/office365-owa/webview.js')
-rw-r--r--recipes/office365-owa/webview.js11
1 files changed, 3 insertions, 8 deletions
diff --git a/recipes/office365-owa/webview.js b/recipes/office365-owa/webview.js
index 0309488..1a04132 100644
--- a/recipes/office365-owa/webview.js
+++ b/recipes/office365-owa/webview.js
@@ -5,12 +5,7 @@ module.exports = Ferdi => {
5 5
6 if (location.pathname.match(/\/owa/)) { 6 if (location.pathname.match(/\/owa/)) {
7 // classic app 7 // classic app
8 directUnreadCount = parseInt( 8 directUnreadCount = Ferdi.safeParseInt(jQuery("span[title*='Inbox'] + div > span").first().text());
9 jQuery("span[title*='Inbox'] + div > span")
10 .first()
11 .text(),
12 10,
13 );
14 } else { 9 } else {
15 // new app 10 // new app
16 const foldersElement = document.querySelector('div[role=tree]:nth-child(3)'); 11 const foldersElement = document.querySelector('div[role=tree]:nth-child(3)');
@@ -18,7 +13,7 @@ module.exports = Ferdi => {
18 const allScreenReaders = foldersElement.querySelectorAll('span.screenReaderOnly'); 13 const allScreenReaders = foldersElement.querySelectorAll('span.screenReaderOnly');
19 for (const child of allScreenReaders) { 14 for (const child of allScreenReaders) {
20 if ((child.innerText === 'unread' || child.innerText === 'item') && child.previousSibling) { 15 if ((child.innerText === 'unread' || child.innerText === 'item') && child.previousSibling) {
21 directUnreadCount += parseInt(child.previousSibling.innerText, 10); 16 directUnreadCount += Ferdi.safeParseInt(child.previousSibling.innerText);
22 } 17 }
23 } 18 }
24 } 19 }
@@ -28,7 +23,7 @@ module.exports = Ferdi => {
28 const allScreenReaders = groupsElement.querySelectorAll('span.screenReaderOnly'); 23 const allScreenReaders = groupsElement.querySelectorAll('span.screenReaderOnly');
29 for (const child of allScreenReaders) { 24 for (const child of allScreenReaders) {
30 if ((child.innerText === 'unread' || child.innerText === 'item') && child.previousSibling) { 25 if ((child.innerText === 'unread' || child.innerText === 'item') && child.previousSibling) {
31 indirectUnreadCount += parseInt(child.previousSibling.innerText, 10); 26 indirectUnreadCount += Ferdi.safeParseInt(child.previousSibling.innerText);
32 } 27 }
33 } 28 }
34 } 29 }