diff options
Diffstat (limited to 'recipes/nextcloud-news/webview.js')
-rw-r--r-- | recipes/nextcloud-news/webview.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/recipes/nextcloud-news/webview.js b/recipes/nextcloud-news/webview.js new file mode 100644 index 0000000..048ac7d --- /dev/null +++ b/recipes/nextcloud-news/webview.js | |||
@@ -0,0 +1,18 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
4 | |||
5 | module.exports = Ferdi => { | ||
6 | const getMessages = () => { | ||
7 | const selector = document.querySelector( | ||
8 | '.subscriptions-feed .app-navigation-entry-utils-counter', | ||
9 | ); | ||
10 | const direct = selector ? Ferdi.safeParseInt(selector.innerText) : 0; | ||
11 | |||
12 | Ferdi.setBadge(direct); | ||
13 | }; | ||
14 | |||
15 | Ferdi.loop(getMessages); | ||
16 | |||
17 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
18 | }; | ||