blob: 8d0f2ca10920f105c6ad74e4c08b7fa168b9a9be (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
module.exports = Ferdium => {
function getTasks() {
let incompleteCount = 0;
const countEls = document.querySelectorAll(
'.AppSidebarGroupsItems__item__link[href^="/tasks/lists/"] .AppSidebarGroupsItems__item__badge > .AppSidebarGroupsItems__item__badge__count > div',
);
if (countEls.length > 0) {
for (const el of countEls) {
incompleteCount += Ferdium.safeParseInt(el.textContent);
}
}
Ferdium.setBadge(incompleteCount);
}
Ferdium.loop(getTasks);
};
|