aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/office365-owa
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/office365-owa')
-rw-r--r--recipes/office365-owa/package.json2
-rw-r--r--recipes/office365-owa/webview.js11
2 files changed, 4 insertions, 9 deletions
diff --git a/recipes/office365-owa/package.json b/recipes/office365-owa/package.json
index e4dce4c..0bd1afd 100644
--- a/recipes/office365-owa/package.json
+++ b/recipes/office365-owa/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "office365-owa", 2 "id": "office365-owa",
3 "name": "Office 365 Outlook", 3 "name": "Office 365 Outlook",
4 "version": "1.4.1", 4 "version": "1.4.2",
5 "license": "MIT", 5 "license": "MIT",
6 "aliases": [ 6 "aliases": [
7 "live.com" 7 "live.com"
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 }