setAppBadge() resolves but no badge appears on the Dock (macOS PWA)

#579714589 Filed 2026-10-30 Assigned · P3 / S3 CL 8709254

Summary

On macOS, calling navigator.setAppBadge(5) inside an installed PWA resolves its promise, but no number badge appears on the app's Dock icon. Notifications and "Badge app icon" are enabled for the app in System Settings; native apps badge correctly on the same machine.

Dock icon: actual vs expected

No badge
PWA Dock icon with no badge
Installed PWA's Dock tile with no badge — the state users are stuck in on affected builds.
Patched build: setAppBadge(5)
PWA Dock icon with a red 5 badge
macOS renders its real "5" badge once the fix calls display + UNUserNotificationCenter.

Both are real screen captures of the installed PWA's own Dock tile (cropped to just that icon) from a locally built Chromium with the fix and AppShimNotificationAttribution enabled. The badge is macOS's own rendering; with notifications granted, setAppBadge(5) now shows it where before it stayed blank.

Live check

This sampler is itself an installable PWA. Install it (address-bar install icon, or ⋮ menu → Cast, Save, and Share → Install page as app…), open the installed app, then trigger the API. On an affected macOS build the promise resolves with no Dock badge; with the fix a 5 appears.

Steps to reproduce

1. Install a PWA (repro'd with Google Chat, Google Meet)
2. Open DevTools console inside the installed app
3. Run: navigator.setAppBadge(5)

Expected

A "5" badge appears on the app's Dock icon.

Actual

Promise resolves (fulfilled, undefined); no badge on the Dock.

Root cause

With AppShimNotificationAttribution, the PWA bundle id registers with macOS usernoted, which then gates NSDockTile.badgeLabel on badge authorization. The app shim set the label but never called [NSApp.dockTile display], UNUserNotificationCenter setBadgeCount:, or re-synced notification settings, so the label was silently suppressed. AppShimManager::UpdateAppBadge also dropped badge updates when the shim was not already running.

Fix

CL 8709254 — [webapps] Fix macOS PWA Dock badging with notification attribution

AppShimController::SetBadgeLabel now calls [NSApp.dockTile display] and forwards the count to UNUserNotificationCenter; MacNotificationServiceUN adds SetBadgeCount() plus a 10s timeout on permission sync; and AppShimManager::UpdateAppBadge launches the shim in the background, re-applies the badge when permission is granted, and surfaces the blocked-by-system indicator when denied.

🐞 Issue 579714589 📄 CL 8709254