Notification.onclose

这篇翻译不完整。请帮忙从英语翻译这篇文章

Summary

Notification  接口的 onclose属性指定一个事件侦听器来接收 close事件。

当一个Notification关闭时,会发生这些事件。

Syntax

Notification.onclose = function() { ... };

Specifications

This event handler is no longer listed in the Notifications API spec.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 22
Notes
Full support 22
Notes
Notes Before Chrome 22, the support for notification followed an old prefixed version of the specification and used the navigator.webkitNotifications object to instantiate a new notification. Before Chrome 32, Notification.permission was not supported. Before Chrome 42, service worker additions were not supported. Starting in Chrome 49, notifications do not work in incognito mode.
Full support 5
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Edge Full support YesFirefox Full support 22
Full support 22
Full support 4
Prefixed
Prefixed Requires the vendor prefix: -moz-
IE No support NoOpera Full support 25Safari Full support 6WebView Android No support NoChrome Android Full support YesEdge Mobile ? Firefox Android Full support 22
Full support 22
Full support 4
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Opera Android Full support YesSafari iOS No support NoSamsung Internet Android ?
Available in workersChrome Full support 45Edge Full support YesFirefox Full support 41IE No support NoOpera Full support 32Safari ? WebView Android No support NoChrome Android Full support 45Edge Mobile Full support YesFirefox Android Full support 41Opera Android Full support 32Safari iOS No support NoSamsung Internet Android ?
Secure contexts onlyChrome Full support 62Edge ? Firefox ? IE No support NoOpera Full support 49Safari ? WebView Android No support NoChrome Android Full support 62Edge Mobile ? Firefox Android ? Opera Android Full support 49Safari iOS No support NoSamsung Internet Android ?
Notification() constructorChrome Full support 22
Full support 22
Full support 5
Prefixed
Prefixed Requires the vendor prefix: webkit
Edge Full support YesFirefox Full support 22
Full support 22
Full support 4
Prefixed
Prefixed Requires the vendor prefix: moz
IE No support NoOpera Full support 25Safari Full support 6WebView Android No support NoChrome Android Full support YesEdge Mobile ? Firefox Android Full support 22
Full support 22
Full support 4
Prefixed
Prefixed Requires the vendor prefix: moz
Opera Android Full support YesSafari iOS No support NoSamsung Internet Android ?
actionsChrome Full support 53Edge Full support 18Firefox No support NoIE No support NoOpera Full support 39Safari ? WebView Android No support NoChrome Android Full support 53Edge Mobile No support NoFirefox Android No support NoOpera Android Full support 39Safari iOS No support NoSamsung Internet Android ?
badgeChrome Full support 53Edge Full support 18Firefox No support NoIE No support NoOpera Full support 39Safari ? WebView Android No support NoChrome Android Full support 53Edge Mobile No support NoFirefox Android No support NoOpera Android Full support 39Safari iOS No support NoSamsung Internet Android ?
bodyChrome Full support YesEdge ? Firefox Full support YesIE No support NoOpera ? Safari ? WebView Android No support NoChrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android ? Safari iOS No support NoSamsung Internet Android ?
dataChrome Full support YesEdge ? Firefox Full support YesIE No support NoOpera ? Safari ? WebView Android No support NoChrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android ? Safari iOS No support NoSamsung Internet Android ?
dirChrome Full support YesEdge ? Firefox Full support YesIE No support NoOpera ? Safari ? WebView Android No support NoChrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android ? Safari iOS No support NoSamsung Internet Android ?
iconChrome Full support 22
Full support 22
Full support 5
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Edge ? Firefox Full support 22
Full support 22
Full support 4
Prefixed
Prefixed Requires the vendor prefix: -moz-
IE No support NoOpera Full support 25Safari No support NoWebView Android No support NoChrome Android Full support YesEdge Mobile ? Firefox Android Full support 22
Full support 22
Full support 4
Prefixed
Prefixed Requires the vendor prefix: -moz-
Opera Android Full support YesSafari iOS No support NoSamsung Internet Android ?
imageChrome Full support 53Edge Full support 18Firefox No support NoIE No support NoOpera Full support 40Safari ? WebView Android No support NoChrome Android Full support 53Edge Mobile ? Firefox Android No support NoOpera Android Full support 40Safari iOS No support NoSamsung Internet Android ?
langChrome Full support YesEdge ? Firefox Full support YesIE No support NoOpera ? Safari ? WebView Android No support NoChrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android ? Safari iOS No support NoSamsung Internet Android ?
maxActionsChrome Full support YesEdge Full support 18Firefox No support NoIE No support NoOpera ? Safari ? WebView Android No support NoChrome Android Full support YesEdge Mobile ? Firefox Android No support NoOpera Android ? Safari iOS No support NoSamsung Internet Android ?
onclickChrome Full support YesEdge ? Firefox No support NoIE No support NoOpera ? Safari ? WebView Android No support NoChrome Android Full support YesEdge Mobile ? Firefox Android No support NoOpera Android ? Safari iOS No support NoSamsung Internet Android ?
oncloseChrome Full support YesEdge ? Firefox Full support YesIE No support NoOpera ? Safari ? WebView Android No support NoChrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android ? Safari iOS No support NoSamsung Internet Android ?
onerrorChrome Full support YesEdge ? Firefox No support NoIE No support NoOpera ? Safari ? WebView Android No support NoChrome Android Full support YesEdge Mobile ? Firefox Android No support NoOpera Android ? Safari iOS No support NoSamsung Internet Android ?
onshowChrome Full support YesEdge ? Firefox Full support YesIE No support NoOpera ? Safari ? WebView Android No support NoChrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android ? Safari iOS No support NoSamsung Internet Android ?
permissionChrome Full support YesEdge ? Firefox Full support YesIE No support NoOpera ? Safari ? WebView Android No support NoChrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android ? Safari iOS No support NoSamsung Internet Android ?
renotifyChrome Full support 50Edge No support NoFirefox No support NoIE No support NoOpera Full support 37Safari No support NoWebView Android No support NoChrome Android Full support 50Edge Mobile No support NoFirefox Android No support NoOpera Android Full support 37Safari iOS No support NoSamsung Internet Android ?
requireInteractionChrome Full support YesEdge Full support 17Firefox No support NoIE No support NoOpera ? Safari ? WebView Android No support NoChrome Android Full support YesEdge Mobile Full support 17Firefox Android No support NoOpera Android ? Safari iOS No support NoSamsung Internet Android ?
silentChrome Full support 43Edge Full support 17Firefox No support NoIE No support NoOpera Full support 30Safari No support NoWebView Android No support NoChrome Android Full support 43Edge Mobile Full support 17Firefox Android No support NoOpera Android Full support 30Safari iOS No support NoSamsung Internet Android ?
tagChrome Full support YesEdge ? Firefox Full support YesIE No support NoOpera ? Safari ? WebView Android No support NoChrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android ? Safari iOS No support NoSamsung Internet Android ?
timestampChrome Full support YesEdge Full support 17Firefox No support NoIE No support NoOpera ? Safari ? WebView Android No support NoChrome Android Full support YesEdge Mobile Full support 17Firefox Android No support NoOpera Android ? Safari iOS No support NoSamsung Internet Android ?
titleChrome Full support YesEdge ? Firefox No support NoIE No support NoOpera ? Safari ? WebView Android No support NoChrome Android Full support YesEdge Mobile ? Firefox Android No support NoOpera Android ? Safari iOS No support NoSamsung Internet Android ?
vibrateChrome Full support 53Edge No support NoFirefox No support NoIE No support NoOpera Full support 39Safari ? WebView Android No support NoChrome Android Full support 53Edge Mobile No support NoFirefox Android No support NoOpera Android Full support 39Safari iOS No support NoSamsung Internet Android ?
closeChrome Full support YesEdge ? Firefox Full support YesIE No support NoOpera ? Safari ? WebView Android No support NoChrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android ? Safari iOS No support NoSamsung Internet Android ?
requestPermissionChrome Full support 46Edge ? Firefox Full support 47IE No support NoOpera Full support 40Safari ? WebView Android No support NoChrome Android Full support 46Edge Mobile ? Firefox Android Full support YesOpera Android Full support 40Safari iOS No support NoSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

See also

文档标签和贡献者

标签: 
此页面的贡献者: xgqfrms-GitHub
最后编辑者: xgqfrms-GitHub,