Add basic support for notifications to web app (closes #29) #33
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
luca0N/lanbassador!33
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev_client_notifications"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add basic support for notifications to the web client. When a host is
detected while the web page is not focused, the number of unread
notifications increments. The number of unread notifications is
displayed in the host list page title (if any) when the page is not in
focus. The number of unread notifications is reset when the user
focuses on the page once again, removing the counter from the page
title.
At this time, there are no options to configure or disable the in-app notifications (as mentioned in the linked issue). If sounds are implemented in the future, the end-user may disable them in their user-agent by disabling the permission to play sounds and music, but the page title still changes, which may be undesirable by some users.
The option to disable in-app notifications can be implemented as a checkbox in a preferences dialog.
I've noticed a bug while testing under Chromium (Brave, to be specific):
In-app notifications are not being displayed at all. However, when
notify()is called, the expected behavior occurs. I believe this might be due to Brave not actually calling theblurevent ondocument, perhaps due to a security/privacy preference. I've tried disabling Brave's Shields on the webpage, but to no avail.Add basic support for notifications to web app (closes #29)to WIP: Add basic support for notifications to web app (closes #29)Firefox seems to have autoplay disabled by default, which causes the in-app notification not to play (unless the autoplay permission is manually granted by the user). Brave (Chromium), on the other hand, autoplays without the need of manually granting an equivalent permission.
I don't believe there's a way around this, unless if there's a way to request the autoplay permission on Firefox, but I don't believe that would be necessary because Firefox already displays an autoplay button that lets the user control this.
Regardless, it would be a good idea to write about this in the documentation.
@luca0N wrote in #33 (comment):
During my troubleshooting, I found out that Firefox calls the
focusandblurevents on bothwindowanddocument, and Brave called it only onwindow. Since those events in Firefox are simultaneously called on bothwindowanddocument, I will just replace wherefocusandblurare being listened and it should now work in both Firefox and Chromium.WIP: Add basic support for notifications to web app (closes #29)to Add basic support for notifications to web app (closes #29)Since the goal of this pull request was to add basic in-app notifications support, this has already been achieved and this pull request may now be merged. In the future, however, I think it'd be a good idea to make use of the Notifications API1.
https://developer.mozilla.org/en-US/docs/Web/API/Notification ↩︎