diff options
author | Carlos SolĂs <csolisr@gmail.com> | 2021-12-02 22:18:54 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-03 09:48:54 +0530 |
commit | 0d6b1c79316dadb3b63f0f2a978ec50621a8418e (patch) | |
tree | 00d5610971815a21a2356aa2df44f472d3f466e6 /recipes/nextcloud-news/webview.js | |
parent | fix: change instagram serviceUrl back to include inbox (fixes #2291) (diff) | |
download | ferdium-recipes-0d6b1c79316dadb3b63f0f2a978ec50621a8418e.tar.gz ferdium-recipes-0d6b1c79316dadb3b63f0f2a978ec50621a8418e.tar.zst ferdium-recipes-0d6b1c79316dadb3b63f0f2a978ec50621a8418e.zip |
Add recipe for Nextcloud News (#780)
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 | }; | ||