blob: d92490b7b2f68c6b2a3b04edee2b7b820d6b7046 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
module.exports = Ferdium => {
const getMessages = () => {
if (document.location.href == 'https://app.hey.com/') {
let screener = 0;
let unread = 0;
if (document.querySelectorAll('.btn--icon-screener').length > 0) {
let text = document.querySelectorAll('.btn--icon-screener')[0]
.textContent;
if (text) {
const parsedText = Ferdium.safeParseInt(/\d+/.exec(text));
screener = parsedText[0];
}
}
let postings = document.querySelectorAll('.posting');
if (postings.length > 0) {
for (const p of postings) {
if (
p.nodeName == 'ARTICLE' &&
p.getAttribute('data-seen') !== 'true'
) {
unread++;
}
}
}
Ferdium.setBadge(unread, screener);
}
};
Ferdium.loop(getMessages);
};
|