Remove alerts from private browsing windows and when clearing site data
Categories
(Toolkit Graveyard :: Notifications and Alerts, task)
Tracking
(firefox106 fixed)
| Tracking | Status | |
|---|---|---|
| firefox106 | --- | fixed |
People
(Reporter: nalexander, Assigned: nrishel)
References
Details
(Whiteboard: [fidedi-notifications])
Attachments
(1 file)
Bug 1774083 changes Windows toast notifications: they will be shunted to the Windows Action Centre rather than being removed entirely when the tab and/or Firefox are closed. To avoid user surprise, we should likely remove alerts entirely from private browsing windows and when clearing site data.
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
| Reporter | ||
Comment 1•3 years ago
|
||
There is a service specifically for cleaning up various things due to user action or on shutdown, nsIClearDataService. We might add a cleaner for system alerts and implement it only on Windows for toast notifications. Start reading around here.
For cleaning up after closing private browsing windows, it rather looks like the relevant observer notification is last-pb-context-exited. That seems to be global, not per-window, but that might not matter.
| Assignee | ||
Comment 2•3 years ago
|
||
nsIAlertService and by extension nsIWindowsAlertsService are being torn down before the last-pb-context-exited (and the currently observed quit-application) observer is called. Any pointers on how service lifetime is managed here? Or was your idea that nsIClearDataService could spin something up or increment nsIAlertService's refcount so that it remains available?
| Assignee | ||
Updated•3 years ago
|
| Reporter | ||
Comment 3•3 years ago
|
||
(In reply to Nick Rishel [:nrishel] from comment #2)
nsIAlertServiceand by extensionnsIWindowsAlertsServiceare being torn down before thelast-pb-context-exited(and the currently observedquit-application) observer is called. Any pointers on how service lifetime is managed here? Or was your idea thatnsIClearDataServicecould spin something up or incrementnsIAlertService's refcount so that it remains available?
If you open a private browsing window and then close it, last-pb-context-exited will fire. It's not tied to application shutdown (quit-application{-granted} and friends). It might be that we need to be more precise about which notifications we allow to live forever, perhaps by conditionally re-instating https://hg.mozilla.org/mozilla-central/rev/ad20680728cc4fefc9ea7254b2b594fc442721ba#l1.59 when the underlying tab is in a private browsing context, to address this.
nsIClearDataService is distinct: it's a system for cleaning things up on exit and from the about:preferences UI.
| Assignee | ||
Comment 4•3 years ago
|
||
Prior to this commit the ToastNotification's observer registration doesn't work due to ToastNotification not implementing nsIWeakReference while attempting to register itself as an observer as a weak reference.
Comment 6•3 years ago
|
||
| bugherder | ||
Updated•2 years ago
|
Description
•