diff options
Diffstat (limited to 'recipes/odysee/webview.js')
-rw-r--r-- | recipes/odysee/webview.js | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/recipes/odysee/webview.js b/recipes/odysee/webview.js index 745e807..f51fb7b 100644 --- a/recipes/odysee/webview.js +++ b/recipes/odysee/webview.js | |||
@@ -1,15 +1,23 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | function getNotifications() { | 8 | function getNotifications() { |
3 | let unreadNotifications = 0; | 9 | let unreadNotifications = 0; |
4 | for (const notificationCounterElement of document.querySelectorAll( | 10 | for (const notificationCounterElement of document.querySelectorAll( |
5 | ".notification__count" | 11 | '.notification__count', |
6 | )) { | 12 | )) { |
7 | unreadNotifications = | 13 | unreadNotifications += Ferdium.safeParseInt( |
8 | unreadNotifications + | 14 | notificationCounterElement.textContent, |
9 | Ferdium.safeParseInt(notificationCounterElement.textContent); | 15 | ); |
10 | } | 16 | } |
11 | 17 | ||
12 | Ferdium.setBadge(unreadNotifications); | 18 | Ferdium.setBadge(unreadNotifications); |
13 | } | 19 | } |
14 | Ferdium.loop(getNotifications); | 20 | Ferdium.loop(getNotifications); |
21 | |||
22 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
15 | }; | 23 | }; |