diff options
Diffstat (limited to 'uncompressed/skype/webview.js')
-rw-r--r-- | uncompressed/skype/webview.js | 25 |
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 | |||
3 | module.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 | ||