mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 00:35:51 +03:00
[GH-ISSUE #112] Remove https restriction for notifications #75
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#75
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Originally created by @jonaskuske on GitHub (May 22, 2023).
Original GitHub issue: https://github.com/axllent/mailpit/issues/112
Notifications should also work on localhost, but since mailpit doesn't rely on the browser to check whether notifications are supported or not but instead does its own https verification, the option does not show up in the UI. Would be nice to remove this artifical restriction, happy to contribute! :)
@axllent commented on GitHub (May 22, 2023):
Hi @jonaskuske. Actually the HTTPS requirement for notifications is a browser restriction, not a Mailpit one. I simply detect the HTTPS state to show/hide the subscription button (to the notifications) to prevent user confusion and browser warnings.
Where did you get your "should also work on localhost" information from?
@jonaskuske commented on GitHub (May 22, 2023):
On MDN itself! The page you linked has a link to
secure contextsright at the top, which says this:Makes absolute sense! I thought this would work just the same without the https check, as
Notification.permission === "denied"on insecure contexts. However, turns out this is only the case on Chrome and Safari, in Firefox it is"default", so permission state isn't enough to determine support there. You can replace thehttpscheck with the well-supported propertyisSecureContext, though:@axllent commented on GitHub (May 23, 2023):
You're absolutely correct, I did not realise
localhostwas exempt from HTTPS! Thanks, I've merged your PR. Now I need to make a couple of minor adjustments to related things (including URl displayed in the CLI and in-browser new mail notifications). I appreciate the info and effort, thank you.@axllent commented on GitHub (May 26, 2023):
I have just released this as part of v1.6.11 - sorry it took so long, I had a very busy week!