Invoke Firefox from notification COM server with enough notification details to allow processing
Categories
(Toolkit Graveyard :: Notifications and Alerts, enhancement)
Tracking
(firefox106 fixed)
Tracking | Status | |
---|---|---|
firefox106 | --- | fixed |
People
(Reporter: nalexander, Assigned: nalexander)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fidedi-notifications])
Attachments
(4 files, 1 obsolete file)
In Bug 1774083, we're adding the scaffolding for launching Firefox from Windows native notifications. We need to ferry a bit more information from the notification through to the launched Firefox to handle more use cases; this ticket tracks doing so.
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Depends on D153658
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
When the notification server callback is executed by the Windows
notification system, it invokes Firefox with additional command line
parameters, most importantly the Windows-specific notification
"Windows tag".
If no appropriate Firefox is running, the command line will be
processed and the provided --notification-fallback-url
opened.
If an appropriate Firefox is running, the remoting protocol will
forward this command line to the running instance. If the instance
recognizes the provided --notification-windowsTag
, the command line
will be ignored. When the notification server exits, Windows will
fallback to the Windows 8.1 style notification callbacks registered
for this Windows tag and the existing (non notification server)
behaviour will occur.
In fact, the server therefore waits for a Windows tag-specific system
event to be signalled by the invoked Firefox (or a sibling process).
If we were to return S_OK
from the notification server immediately,
and a running Firefox process would handle the notification via
Windows 8.1-style notification callbacks, then Windows would fall back
to those callbacks. The invoked callbacks unregister themselves upon
completion, often before the launched Firefox has an opportunity to
process the command line. By waiting for this system event, we allow
the invoked Firefox to process the command line while its own
notification callbacks are registered and therefore recognize that its
callbacks will handle the notification.
Depends on D153659
Assignee | ||
Comment 3•2 years ago
•
|
||
nrishel: over in https://phabricator.services.mozilla.com/D154468, you can see some of the ideas coming together here. Fundamentally, your idea of waiting for a Windows system event seems sound. I tried to explain what was up in the commit comment.
I would very much appreciate it if you span the Event Log stuff out into a separate ticket and worked with Ray to address their review comments and get it landed. That's all preparatory to this ticket.
There are a few things left to work through here that I don't expect you to push on while I'm PTO.
- The
SetEvent
is happening in a check function for convenience. That should be separate or have a better name. - We need some concept of a
fallbackUrl
to launch when Firefox isn't running and/or doesn't have notification handlers registered. You can see that here, but what's not correct is how the background taskToastNotification.jsm
mechanism will specify that URL. Perhaps it's part of theaction
? - Background task toasts want to use
systemAction
forsnooze
anddismiss
. Again,ToastNotification.jsm
has to grow to support that. (And the Windows-only alert service has to accommodate these details. Tricky.)
Maybe take this as a base while you work on the WDBA notifications next week and we'll regroup when I'm back?
Updated•2 years ago
|
Comment 4•2 years ago
|
||
Updated•2 years ago
|
Comment 5•2 years ago
|
||
Comment on attachment 9290714 [details]
WIP: Bug 1781929 - Recover prior Windows toast notifications launched by app with current profile when initializing Windows native toast notification service. r=nalexander
Revision D155125 was moved to bug 1783081. Setting attachment 9290714 [details] to obsolete.
Assignee | ||
Comment 6•2 years ago
|
||
In background task mode:
- Re-launch Firefox into the default browsing profile, not the
(possibly ephemeral) background task profile. - Don't show the in-product notification settings, which won't apply
to the relevant Firefox profile.
Depends on D155907
Updated•2 years ago
|
Assignee | ||
Comment 7•2 years ago
|
||
Depends on D153659
Updated•2 years ago
|
Pushed by nalexander@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/abf6eff708d8 Part 1: Handle toast notifications from background tasks specially. r=nrishel https://hg.mozilla.org/integration/autoland/rev/e50432e37751 Part 2: Include executable as first argument; log to Windows Event Log. r=nrishel https://hg.mozilla.org/integration/autoland/rev/8e6fe1c18e8d Part 3: Include `launchUrl` in Windows toast notification. r=nrishel https://hg.mozilla.org/integration/autoland/rev/34003f6f7b27 Part 4: Pass through or launch Firefox from notification server. r=nrishel
Comment 9•2 years ago
•
|
||
Backed out 5 changesets (Bug 1781929, Bug 1784367) for causing bc test failures.
Backout link
Push with failures <--> bc3 <--> x
Failure Log
Also x failure log
Comment 10•2 years ago
|
||
Pushed by nalexander@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cd529052e4c3 Part 1: Handle toast notifications from background tasks specially. r=nrishel https://hg.mozilla.org/integration/autoland/rev/0269445d430b Part 2: Include executable as first argument; log to Windows Event Log. r=nrishel https://hg.mozilla.org/integration/autoland/rev/1a985841bfce Part 3: Include `launchUrl` in Windows toast notification. r=nrishel https://hg.mozilla.org/integration/autoland/rev/7507acebeaa1 Part 4: Pass through or launch Firefox from notification server. r=nrishel
Assignee | ||
Comment 11•2 years ago
|
||
Clearing NI since I relanded this yesterday.
Comment 12•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cd529052e4c3
https://hg.mozilla.org/mozilla-central/rev/0269445d430b
https://hg.mozilla.org/mozilla-central/rev/1a985841bfce
https://hg.mozilla.org/mozilla-central/rev/7507acebeaa1
Updated•10 months ago
|
Description
•