aboutsummaryrefslogtreecommitdiffstats
path: root/uncompressed/skype/webview.js
diff options
context:
space:
mode:
authorLibravatar vantezzen <hello@vantezzen.io>2019-09-28 12:10:25 +0200
committerLibravatar vantezzen <hello@vantezzen.io>2019-09-28 12:10:25 +0200
commit728d339739b63e9bb59e457e4a84fe9a65b93fc9 (patch)
treea0fc6180ea26fa9ef397458e8eb6491031d6437d /uncompressed/skype/webview.js
parentAdd list of recipes (diff)
downloadferdium-recipes-728d339739b63e9bb59e457e4a84fe9a65b93fc9.tar.gz
ferdium-recipes-728d339739b63e9bb59e457e4a84fe9a65b93fc9.tar.zst
ferdium-recipes-728d339739b63e9bb59e457e4a84fe9a65b93fc9.zip
Add uncompressed recipes
Diffstat (limited to 'uncompressed/skype/webview.js')
-rw-r--r--uncompressed/skype/webview.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/uncompressed/skype/webview.js b/uncompressed/skype/webview.js
new file mode 100644
index 0000000..798eccb
--- /dev/null
+++ b/uncompressed/skype/webview.js
@@ -0,0 +1,25 @@
1"use strict";
2
3module.exports = Franz => {
4 const getMessages = function getMessages() {
5 let count = 0;
6 const container = document.querySelector('[role="tablist"] > [title="Chats"] > div');
7
8 if (container) {
9 const children = container.children;
10
11 if (children.length === 3) {
12 const elementContainer = children[children.length - 1];
13
14 if (elementContainer) {
15 const element = elementContainer.querySelector('[data-text-as-pseudo-element]');
16 count = parseInt(element.dataset.textAsPseudoElement, 10);
17 }
18 }
19 }
20
21 Franz.setBadge(count);
22 };
23
24 Franz.loop(getMessages);
25}; \ No newline at end of file