Notification
The Notification
interface of the Notifications API is used to configure and display desktop notifications to the user.
Documentation Notification by Mozilla Contributors, licensed under CC-BY-SA 2.5.
Static Members
permission: NotificationPermission
A string representing the current permission to display notifications. Possible values are:
denied
— The user refuses to have notifications displayed.
granted
— The user accepts having notifications displayed.
default
— The user choice is unknown and therefore the browser will act as if the value were denied.
Instance Members
onclick: haxe.Function
A handler for the click
event. It is triggered each time the user clicks on the notification.
onshow: haxe.Function
A handler for the show
event. It is triggered when the notification is displayed.
onerror: haxe.Function
A handler for the error
event. It is triggered each time the notification encounters an error.
onclose: haxe.Function
A handler for the close
event. It is triggered when the user closes the notification.
title: String
The title of the notification as specified in the first parameter of the constructor.
The text direction of the notification as specified in the constructor's options
parameter.
lang: String
The language code of the notification as specified in the constructor's options
parameter.
body: String
The body string of the notification as specified in the constructor's options
parameter.
tag: String
The ID of the notification (if any) as specified in the constructor's options
parameter.
icon: String
The URL of the image used as an icon of the notification as specified in the constructor's options
parameter.
data: Dynamic
Returns a structured clone of the notification’s data.
close(): Void
Programmatically closes a notification.
new(title: String, ?options: Null<NotificationOptions>): Void
Name | Type | Default |
---|---|---|
title |
String | |
options |
Null<NotificationOptions> | (optional) |