Clicking Dismiss button on Windows still opens the corresponding tab
Categories
(Toolkit :: Alerts Service, defect)
Tracking
()
People
(Reporter: saschanaz, Assigned: saschanaz)
References
Details
Attachments
(2 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
dmeehan
:
approval-mozilla-release+
|
Details | Review |
Dismiss button should just dismiss the notification, and should not open anything.
| Assignee | ||
Comment 1•3 years ago
|
||
I can't reproduce this with https://googlechrome.github.io/samples/notifications/requireInteraction.html but I saw such behavior in Google Calendar. Not sure the difference, maybe only push notifications are affected? But how?
| Assignee | ||
Comment 2•3 years ago
|
||
Actually it's the Chrome example that is special, because new Notification("foo", { requireInteraction: true }) is enough to reproduce the issue.
Comment 3•3 years ago
|
||
The severity field is not set for this bug.
:nalexander, could you have a look please?
For more information, please visit BugBot documentation.
This issue is also happening with me. (Clicking the dismiss button opens the notification's respective link/tab)
Firefox 117.0 (64-bit)
Windows 11 23H2 - Build 22631.2271
Comment 5•3 years ago
|
||
The Chrome-example uses a service worker as one would do for Web Push, too. As far as I know, one needs to handle the event notificationclick in the service worker to focus or open the site. Doing so leads to the problem that is described in this bug, too: A click on the dismiss-button focuses / opens the site. So, Web Push is affected, too.
I believe that the problem in case of Web Push is that the event notificationclick is fired on click on the dismiss-button without a possibility for the event-handler to detect that only the dismiss-button was clicked. I have never recognized that Chrome fires the event on click on the dismiss-button. So, sites would need different handling for different browsers, but it seems that there is not even a solution for Firefox.
I don’t know if the root-cause for Web Push and not Web Push is the same.
| Assignee | ||
Comment 7•2 years ago
|
||
Per the documentation the system should handle arguments=dismiss to fire dismiss event but somehow it still fires activate event. This patch thus handles it manually while still taking advantage of the Windows provided localization of the button.
Comment 9•2 years ago
|
||
Backed out for xpcshell failures on test_windows_alert_service.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/6a775bef9e3ba3adedc5ed068247c87e8cc9f8ad
Log link: https://treeherder.mozilla.org/logviewer?job_id=443135032&repo=autoland&lineNumber=5298
Comment 10•2 years ago
|
||
Comment 11•2 years ago
|
||
| bugherder | ||
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 12•2 years ago
|
||
Comment on attachment 9372283 [details]
Bug 1848801 - Use system dismiss button for persistent notification r=nalexander,nrishel
Beta/Release Uplift Approval Request
- User impact if declined: (Probably is too late for beta, though)
Users getting persistent notification popup will click Dismiss button which unexpectedly opens the webpage, which is the opposite of what Dismiss is. See also bug 1863182.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: 1. Open https://www.bennish.net/web-notifications.html
- Click Authorize
- Open F12 devtools console and copypaste
new Notification("foo", { requireInteraction: true }) - See the resulting notification
- Do either one of below:
a. switch to another tab
b. switch to another window
c. close the current page (while not closing Firefox)
d. close Firefox - Click the Dismiss button on the notification
- See the button do not trigger anything e.g. opening Firefox, focusing the previous window, or switching to the tab.
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): This only changes some arguments we pass to the OS.
- String changes made/needed:
- Is Android affected?: No
| Assignee | ||
Updated•2 years ago
|
Comment 13•2 years ago
|
||
Comment on attachment 9372283 [details]
Bug 1848801 - Use system dismiss button for persistent notification r=nalexander,nrishel
Fx122 is now in release, switching uplift request to release as a possible ride-along
Updated•2 years ago
|
Comment 14•2 years ago
|
||
The patch landed in nightly and beta is affected.
:saschanaz, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox122towontfix.
For more information, please visit BugBot documentation.
Updated•2 years ago
|
| Assignee | ||
Comment 15•2 years ago
|
||
We have a release approval nomination instead for a good reason!
Comment 16•2 years ago
|
||
I have reproduced this issue in Beta v122.0 (RC) on Windows 10.
Steps used:
- Open https://www.bennish.net/web-notifications.html
- Click Authorize
- Open F12 devtools console and copypaste new Notification("foo", { requireInteraction: true })
- See the resulting notification
- Do either one of below:
a. switch to another tab
b. switch to another window
c. close the current page (while not closing Firefox)
d. close Firefox
Click the Dismiss button on the notification
See the button do not trigger anything e.g. opening Firefox, focusing the previous window, or switching to the tab.
It only reproduced in cases a and b. cases c and d do not reopen the closed browser or tab.
This issue no longer occurs in Nightly v123.0a1 (from 2024-01-16).
Comment 17•2 years ago
|
||
:saschanaz widget/windows/ToastNotificationHandler.cpp has merge conflicts with release.
If you can attach a patch rebased on release, we can include this in a dot release ride-along.
| Assignee | ||
Comment 18•2 years ago
|
||
Per the documentation the system should handle arguments=dismiss to fire dismiss event but somehow it still fires activate event. This patch thus handles it manually while still taking advantage of the Windows provided localization of the button.
Updated•2 years ago
|
Updated•2 years ago
|
Comment 20•2 years ago
|
||
Comment on attachment 9373595 [details]
Bug 1848801 - Use system dismiss button for persistent notification r=dmeehan
Approved for 122.0.1
Comment 21•2 years ago
|
||
| uplift | ||
Updated•2 years ago
|
Comment 22•2 years ago
|
||
I confirm this fix in RC V122.0.1 in Windows 10. Clicking the Windows notification's "Dismiss" button does not refocus the tab, the window or reopen the browser.
Description
•