Notification.onshow - Web API 接口参考 编辑

Summary

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

当一个 Notification 显示时,会发生这些事件。

Syntax

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

Specifications

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

Browser compatibility

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support 22Notes
Full support 22Notes
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 5Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Edge Full support YesFirefox Full support 22
Full support 22
Full support 4Prefixed
Prefixed Implemented with 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 4Prefixed
Prefixed Implemented with 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 5Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support YesFirefox Full support 22
Full support 22
Full support 4Prefixed
Prefixed Implemented with 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 4Prefixed
Prefixed Implemented with 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 5Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Edge ?Firefox Full support 22
Full support 22
Full support 4Prefixed
Prefixed Implemented with 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 4Prefixed
Prefixed Implemented with 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 No support NoFirefox 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 No support NoFirefox 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 No support NoFirefox 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.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:98 次

字数:77456

最后编辑:8 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文