diff options
Diffstat (limited to 'recipes/icq/webview.js')
-rw-r--r-- | recipes/icq/webview.js | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/recipes/icq/webview.js b/recipes/icq/webview.js index 24271d8..653dc69 100644 --- a/recipes/icq/webview.js +++ b/recipes/icq/webview.js | |||
@@ -1,15 +1,10 @@ | |||
1 | module.exports = Ferdi => { | 1 | module.exports = Ferdi => { |
2 | const getMessages = function getMessages() { | 2 | const getMessages = function getMessages() { |
3 | let directs = 0; | 3 | let directs = 0; |
4 | 4 | const elements = document.getElementsByClassName('nwa-msg-counter icq-recent_state-read'); | |
5 | if (document.getElementsByClassName('nwa-msg-counter icq-recent_state-read').length > 0) { | 5 | for (let i = 0; i < elements.length; i++) { |
6 | const elements = document.getElementsByClassName('nwa-msg-counter icq-recent_state-read'); | 6 | if (Ferdi.safeParseInt(elements[i].innerText.replace(/[^0-9.]/g, '')) > 0) { |
7 | for (let i = 0; i < elements.length; i++) { | 7 | directs += 1; // count 1 per channel with messages |
8 | const countLine = parseInt(elements[i].innerText.replace(/[^0-9.]/g, ''), 10); | ||
9 | if (!isNaN(directs) && countLine > 0) { | ||
10 | // directs += count_line; // count every message | ||
11 | directs += 1; // count 1 per channel with messages | ||
12 | } | ||
13 | } | 8 | } |
14 | } | 9 | } |
15 | 10 | ||