hamsket
hamsket copied to clipboard
Whatsapp new message
Steps to reproduce
- Recieve new message on Whatsapp account
Expected behavior
See unread message count in badge and red icon in system tray.
Actual behavior
Nothing happened.
I have also tried latest Rambox CE 0.7.9 and same bad behaviour.
ENVIRONMENT
Hamsket: v0.6.3
OS: Windows 10 Pro
Arch: x64
BuildVersion: 4b36e9f
Does this happen upstream: unknown
Same issue with me as well. Looks like the js_unread
is somehow bad? Where can I find the code that goes into js_unread
?
Unread message count can be obtained using this snippet (doesn't handle muted conversations):
const unreadSpans = document.querySelectorAll('span[aria-label]');
if (unreadSpans) { hamsket.setUnreadCount([...unreadSpans].map(x => Number(x.textContent)).reduce((a, b) => a + b)); }
Hello, any chance to make whatsapp notification badge working again soon? It is really pain in the *ss
Unread message count can be obtained using this snippet (doesn't handle muted conversations):
const unreadSpans = document.querySelectorAll('span[aria-label]'); if (unreadSpans) { hamsket.setUnreadCount([...unreadSpans].map(x => Number(x.textContent)).reduce((a, b) => a + b)); }
I've dropped into 0.6.3 Whatsapp's "custom badge update js" but no results...
I copied the query from ServicesList.js and replaced the query selector with "#pane-side div span div span[aria-label]"
. So the following custom JS worked for me with 0.6.3:
let checkUnread=()=>{const elements=document.querySelectorAll("#pane-side div span div span[aria-label]");let count=0;for(const i of elements){const gp=i.parentNode.parentNode;0===gp.querySelectorAll('#pane-side *[data-icon="muted"]').length&&count++}hamsket.updateBadge(count)};setInterval(checkUnread,1e3);let unregister_queue=[];navigator.serviceWorker.getRegistrations().then(registrations=>{for(const registration of registrations)unregister_queue.push(registration.unregister());return unregister_queue}).then(queue=>{}).catch(err=>{});
I copied the query from ServicesList.js and replaced the query selector with
"#pane-side div span div span[aria-label]"
. So the following custom JS worked for me with 0.6.3:let checkUnread=()=>{const elements=document.querySelectorAll("#pane-side div span div span[aria-label]");let count=0;for(const i of elements){const gp=i.parentNode.parentNode;0===gp.querySelectorAll('#pane-side *[data-icon="muted"]').length&&count++}hamsket.updateBadge(count)};setInterval(checkUnread,1e3);let unregister_queue=[];navigator.serviceWorker.getRegistrations().then(registrations=>{for(const registration of registrations)unregister_queue.push(registration.unregister());return unregister_queue}).then(queue=>{}).catch(err=>{});
great workaround - I confirm it works
I have a solution. An Old release of Rambox v 0.8.0 works and looks exactly the same as Hamsket, but whatsapp unread messages work: https://github.com/ramboxapp/community-edition/releases