mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Add notification support to a few older browsers and Safari
This commit is contained in:
parent
4a219e1360
commit
57f0abe370
1 changed files with 4 additions and 1 deletions
|
|
@ -374,7 +374,10 @@ function onNewLine(text, originator) {
|
|||
document.title = "(" + unread + ") " + originalTitle;
|
||||
if ("Notification" in window){
|
||||
if (("notification_popup" in options) && (options["notification_popup"])) {
|
||||
Notification.requestPermission().then(function(result) {
|
||||
// There is a Promise-based API for this, but it’s not supported
|
||||
// in Safari and some older browsers:
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission#Browser_compatibility
|
||||
Notification.requestPermission(function(result) {
|
||||
if(result === "granted") {
|
||||
var title = originalTitle === "" ? "Evennia" : originalTitle;
|
||||
var options = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue