diff options
Diffstat (limited to 'recipes/erepublik/webview.js')
-rw-r--r-- | recipes/erepublik/webview.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/recipes/erepublik/webview.js b/recipes/erepublik/webview.js index 6a105e1..a47c57d 100644 --- a/recipes/erepublik/webview.js +++ b/recipes/erepublik/webview.js | |||
@@ -4,19 +4,19 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de | |||
4 | 4 | ||
5 | module.exports = Ferdi => { | 5 | module.exports = Ferdi => { |
6 | const getMessages = () => { | 6 | const getMessages = () => { |
7 | const elementNotify = document.getElementsByClassName('notify'); | 7 | const elementNotify = document.querySelectorAll('.notify'); |
8 | const elementFeed = document.getElementsByClassName('unreadCounter ng-binding ng-scope'); | 8 | const elementFeed = document.querySelectorAll('.unreadCounter.ng-binding.ng-scope'); |
9 | 9 | ||
10 | let countNotify = 0; | 10 | let countNotify = 0; |
11 | let countFeed = 0; | 11 | let countFeed = 0; |
12 | 12 | ||
13 | for (let i = 0; i < elementNotify.length; i++) { | 13 | for (const element of elementNotify) { |
14 | const splitText = elementNotify[i].title.split(':'); | 14 | const splitText = element.title.split(':'); |
15 | countNotify += Ferdi.safeParseInt(splitText[1]); | 15 | countNotify += Ferdi.safeParseInt(splitText[1]); |
16 | } | 16 | } |
17 | 17 | ||
18 | for (let i = 0; i < elementFeed.length; i++) { | 18 | for (const element of elementFeed) { |
19 | countFeed += Ferdi.safeParseInt(elementFeed[i].textContent); | 19 | countFeed += Ferdi.safeParseInt(element.textContent); |
20 | } | 20 | } |
21 | 21 | ||
22 | Ferdi.setBadge(countNotify, countFeed); | 22 | Ferdi.setBadge(countNotify, countFeed); |