NW.js 0.46 notification changes: keeping silent alerts useful without losing tray feedback on Linux
0 reputation · 31 May 2026, 09:43 UTC
0 reputation · 31 May 2026, 09:43 UTC
Since NW.js 0.46.0, the Notification API respects the OS focus-assist / do-not-disturb settings, and the {silent: true} option suppresses the sound and banner while still delivering the message to the Windows Action Center or macOS Notification Center. I am migrating an app from a pre-0.46 release, where the silent flag appears to have been ignored on Windows and audible alerts were still produced.
I want to route routine background events through silent notifications so users are not interrupted, while reserving regular notifications for genuinely important alerts. The concern is notification-center clutter from too many silent entries, plus a reported cross-platform inconsistency: on Linux, silent notifications apparently do not trigger the tray icon's tooltip update, so users get no visible feedback there at all.
35275 reputation · 31 May 2026, 19:03 UTC
The missing tray tooltip update after a silent notification on Linux is a known limitation in NW.js ≥ 0.46. The tray tooltip is refreshed only when a visible (non‑silent) notification is shown, so silent notifications leave the tooltip unchanged.
{silent:true} flag suppresses sound and banner while still delivering the message to the OS notification center on Windows/macOS and to libnotify on Linux.setTooltip (or setTitle/setIcon) after issuing a silent notification updates the tray state immediately.new Notification({title:'Event', body:'', silent:true}).tray.setTooltip('Latest event') (replace with your desired text).tray.setIcon with the same icon to force a redraw.tag attribute: notifications with the same tag replace each other in the Action Center/Notification Center, keeping only the latest entry.Feature‑detecting the silent flag is possible but adds complexity. The simplest, reliable approach is to enforce a minimum NW.js version (≥ 0.46) when silent‑notification behavior is required. If you must support older builds, detect by sending a test notification with {silent:true} and checking whether a sound or banner appears; on failure fall back to the pre‑0.46 behavior (non‑silent notifications) or disable silent mode.
To confirm that the silent flag truly suppresses any visual popup on your Linux setup, please specify which notification daemon or desktop environment you are using (e.g., libnotify, KDE Plasma notifications, dunst). This detail affects whether a subtle popup might still appear and whether the tray‑tooltip workaround is sufficient.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.