diff options
author | 2020-02-05 20:00:14 +0100 | |
---|---|---|
committer | 2020-02-05 20:00:14 +0100 | |
commit | 8980eb2b8b05daf4350995da39c87814c3f66098 (patch) | |
tree | 8e1cf01cbd3bac0942b789013aca114501bfee60 /uncompressed/twitter/webview.js | |
parent | Add load recipe script (diff) | |
download | ferdium-recipes-8980eb2b8b05daf4350995da39c87814c3f66098.tar.gz ferdium-recipes-8980eb2b8b05daf4350995da39c87814c3f66098.tar.zst ferdium-recipes-8980eb2b8b05daf4350995da39c87814c3f66098.zip |
Add Twitter recipe
Diffstat (limited to 'uncompressed/twitter/webview.js')
-rw-r--r-- | uncompressed/twitter/webview.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/uncompressed/twitter/webview.js b/uncompressed/twitter/webview.js new file mode 100644 index 0000000..75655f1 --- /dev/null +++ b/uncompressed/twitter/webview.js | |||
@@ -0,0 +1,17 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Franz => { | ||
4 | const getMessages = () => { | ||
5 | var direct = 0; | ||
6 | |||
7 | // "Notifications" and "Messages" - aria-label ending in | ||
8 | // "unread items". Sum the values for direct badge. | ||
9 | direct += document.querySelector('[data-testid=AppTabBar_Notifications_Link] div div div').innerHTML; | ||
10 | direct += document.querySelector('[data-testid=AppTabBar_DirectMessage_Link] div div div').innerHTML; | ||
11 | |||
12 | Franz.setBadge(direct); | ||
13 | }; | ||
14 | |||
15 | Franz.loop(getMessages); | ||
16 | |||
17 | }; \ No newline at end of file | ||