Originally created by: kristofferR
With one unread conversation, no badge appears on the Dock icon.
unreadBadge in src-tauri/inject/messenger.js watches document.title for the unread count Facebook puts there (e.g. (1) Messenger), parses \((\d+)\), and calls plugin:window|set_badge_count with the count (or null to clear). It also emits carrier:unread for the tray tooltip.
set_badge_count(Option<i64>) and permission core:window:allow-set-badge-count (in capabilities/default.json) match Tauri 2.10.unread_badge setting is true.__TAURI_INTERNALS__ present), with a <title> MutationObserver + a 15s interval + a carrier:settings listener.Facebook's facebook.com/messages document.title may not carry the (N) count in the state being observed — e.g. it's only present when the tab is backgrounded, or the format differs from messenger.com. If so, the regex finds nothing → count = 0 → no badge.
Use the new tauri-mcp dev tooling (execute_js) to read document.title (and the unread DOM) in the logged-in app and confirm whether (N) is present. If the title is unreliable, switch to DOM-based unread detection (count unread conversation rows / FB's own unread indicator) instead of the title.
Originally posted by: kristofferR
Fixed and merged via [#11] (now on
main). There were two root causes, both addressed and verified end-to-end (Dock badge read back from the OS):messenger.jscalledplugin:window|set_badge_countwith{ count: n }, but Tauri'ssetter!macro names the argumentvalue, so the count was always dropped and the badge cleared on every update. Now sends{ value: ... }.setBadgeLabel:is silently ignored unless the app has requestedUNUserNotificationCenterauthorization with the badge option. Carrier now requests it once onRunEvent::Readyviarequest_badge_authorization(granted silently, no prompt).PR [#11] also added a badge-count mode setting (unread messages vs. unread conversations) and made the badge reload-safe. Closing as resolved.
Related
Tickets:
#11Ticket changed by: kristofferR