diff options
author | 2020-09-22 20:56:48 +0200 | |
---|---|---|
committer | 2020-09-22 19:56:48 +0100 | |
commit | 6f5e4a00588aefdda7a5a1cfe70935870e7e234a (patch) | |
tree | 9e29aa7aa0620a1a4a968ff8739b4b8ba96791a9 /recipes/tweetdeck/webview.js | |
parent | Updated logos for Outlook/OWA (diff) | |
download | ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.tar.gz ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.tar.zst ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.zip |
Unpack recipes and update recipes icons (#292)
Co-authored-by: Amine Mouafik <amine@mouafik.fr>
Diffstat (limited to 'recipes/tweetdeck/webview.js')
-rw-r--r-- | recipes/tweetdeck/webview.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/recipes/tweetdeck/webview.js b/recipes/tweetdeck/webview.js new file mode 100644 index 0000000..dbf004c --- /dev/null +++ b/recipes/tweetdeck/webview.js | |||
@@ -0,0 +1,22 @@ | |||
1 | 'use strict'; | ||
2 | |||
3 | const { ipcRenderer } = require('electron'); | ||
4 | |||
5 | // Tweetdeck redirect fix | ||
6 | ipcRenderer.on('redirect-url', (event, url) => { | ||
7 | window.location.assign(url); | ||
8 | }); | ||
9 | |||
10 | module.exports = Franz => { | ||
11 | const getMessages = function getMessages() { | ||
12 | const elements = document.querySelectorAll('.msg-unread-count'); | ||
13 | let count = 0; | ||
14 | if (elements[0]) { | ||
15 | count = parseInt(elements[0].innerHTML, 10); | ||
16 | } | ||
17 | |||
18 | Franz.setBadge(count); | ||
19 | }; | ||
20 | Franz.loop(getMessages); | ||
21 | }; | ||
22 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInR3ZWV0ZGVjay93ZWJ2aWV3LmpzIl0sIm5hbWVzIjpbImlwY1JlbmRlcmVyIiwicmVxdWlyZSIsIm9uIiwiZXZlbnQiLCJ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