Skip to content

fix: open relevant chat context on notification click across services - #2589

Open
AzzBAN wants to merge 1 commit into
ferdium:developfrom
AzzBAN:fix-notification-click-handling
Open

AzzBAN wants to merge 1 commit into
ferdium:developfrom
AzzBAN:fix-notification-click-handling

Conversation

@AzzBAN

@AzzBAN AzzBAN commented Oct 15, 2026 •

Copy link
Copy Markdown

Pre-flight Checklist

Please ensure you've completed all of the following.

Description of Change

Enhance WrapNotification in the webview preload to implement full standard EventTarget behavior and forward notification click events to guest services and Service Workers:

  • WrapNotification now extends EventTarget, enabling both addEventListener("click", ...) and onclick callbacks with a standard Event argument.
  • Preserves notification properties (title, body, data, tag, icon, dir, lang, silent) on the notification instance.
  • Updates ServiceWorkerRegistration.prototype.showNotification to return Promise.resolve() (matching W3C spec) and forward complete options (including data and tag).
  • Dispatches NOTIFICATION_CLICK postMessage to navigator.serviceWorker.controller and WhatsApp NOTIFICATION_BANNER_CLICKED bus event when clicked.
  • Adds comprehensive unit tests in test/webview/notifications.test.ts.

Motivation and Context

Fixes #263. When users clicked desktop notification banners for services like WhatsApp, Slack, Discord, or Google Chat, Ferdium would focus and switch to the active service tab, but the guest webview never opened the relevant conversation/channel context because WrapNotification did not support addEventListener("click"), omitted notification metadata properties, and did not notify Service Workers.

Checklist

  • My pull request is properly named
  • The changes respect the code style of the project (pnpm prepare-code)
  • pnpm test passes
  • I tested/previewed my changes locally

Release Notes

Fix issue where clicking desktop notifications did not open the relevant conversation or channel in guest services.

Relates to #2590 and ferdium/ferdium-recipes#760.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Clicking on notification doesn't open relevant context in Ferdium

1 participant