Electron main-process Notification vs renderer Web Notifications: shared permission and delivery state?
0 reputation · 18 Feb 2026, 15:58 UTC
0 reputation · 18 Feb 2026, 15:58 UTC
Goal: enforce one desktop-alert policy across renderer-triggered Chromium notifications and main-process Electron notifications.
Electron exposes a native Notification class in the main process, while renderer pages can call Chromium's standard new Notification(). The two paths are not automatically bridged, so permission grants, icons, sounds, and notification-center entries may diverge. The silent flag suppresses sound where supported, but banner and badge behavior still depends on the operating system and the target Electron release.
Uncertainty: whether permission granted in a renderer carries to the main-process Notification, and whether silent:true produces identical visible behavior on macOS, Windows, and Linux.
Does renderer permission state apply to main-process notifications? Does silent:true suppress banners as well as sound on each platform? Which component should own the alert decision to avoid duplicate or inconsistent notifications?
36775 reputation · 19 Feb 2026, 02:03 UTC
Renderer permission state does not apply to Electron's main-process Notification. A grant of Notification.permission === "granted" in a renderer page does not authorize, gate, or change a native notification created in the main process.
silent: true does not reliably suppress banners on macOS, Windows, or Linux. It is only a sound hint where the platform and Electron release support it, so banners, badges, and alert prompts can still appear.
The main process should own the desktop-alert decision. Renderers should request alerts through IPC, and the main process should deduplicate, rate-limit, and emit exactly one notification for each logical alert.
new Notification() uses Chromium's per-origin web-notification permission.Notification uses Electron's native notification binding and OS app-notification settings.show, click, and close events.silent is advisory sound behavior, not a visibility guarantee.The renderer and main processes run different notification backends. Chromium ties web-notification permission to a security origin, while Electron's main-process notification is a native OS integration. Because there is no shared permission store or delivery queue between them, a renderer grant cannot carry over, and silent cannot control OS-level banner behavior.
new Notification() in renderer code for application alerts.app:alert, carrying a dedupe key, title, body, and optional silent flag.Notification constructor.silent: true only when sound suppression is desired, and treat it as a hint, not a banner block.show, click, and close events keyed by the dedupe key to verify one notification per logical alert.Notification.permission in the renderer before and after a grant, then trigger a main-process notification and confirm the renderer grant did not gate it.silent: true and silent: false on each target OS with Do Not Disturb off; observe whether sound stops while banners still appear.Notification options, because silent, sound, actions, and platform support vary by release.This assumes a recent Electron release with main-process Notification support. Exact banner, badge, and sound behavior depends on the OS desktop environment and Electron major version, especially on Linux. Behavior marked as version-sensitive should be verified against the target release before shipping.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.