安全上下文
此特征只可用于
安全上下文
(HTTPS),在某些或所有
支持浏览器
.
icon
只读特性在
Notification
interface contains the URL of an icon to be displayed as part of the notification, as specified in the
icon
option of the
Notification()
构造函数。
var icon = Notification.icon;
A
USVString
.
In our
To-do list app
(
view the app running live
), we use the
Notification()
constructor to fire a notification, passing it arguments to specify the body, icon and title we want.
var notification = new Notification('To do list', {
body: text,
icon: img
});
| 规范 | 状态 | 注释 |
|---|---|---|
|
Notifications API
The definition of 'icon' in that specification. |
实时标准 | Living standard |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
icon
|
Chrome
22
|
Edge 14 |
Firefox
22
|
IE No | Opera 25 | Safari No | WebView Android No | Chrome Android Yes |
Firefox Android
22
|
Opera Android Yes | Safari iOS No | Samsung Internet Android Yes |
完整支持
不支持
要求使用供应商前缀或不同名称。
Notification