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