安全上下文
此特征只可用于
安全上下文
(HTTPS),在某些或所有
支持浏览器
.
vibrate
只读特性在
Notification
interface specifies a a
vibration pattern
for the device's vibration hardware to emit when the notification fires. This is specified in the
vibrate
option of the
Notification()
构造函数。
var vibrate = Notification.vibrate;
A vibration pattern , as specified in the Vibration API spec .
The following snippet is intended to create a notification that also triggers a device vibration; a simple
选项
object is created, and then the notification is fired using the
Notification()
构造函数。
var options = {
body: 'Do you like my body?',
vibrate: [200, 100, 200]
}
var n = new Notification('Test notification',options);
console.log(n.vibrate) // should log [200,100,200]
| 规范 | 状态 | 注释 |
|---|---|---|
|
Notifications API
The definition of 'vibrate' in that specification. |
实时标准 | Living standard |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
vibrate
|
Chrome No | Edge No | Firefox No | IE No | Opera No | Safari ? | WebView Android No |
Chrome Android
53
|
Firefox Android No |
Opera Android
41
|
Safari iOS No |
Samsung Internet Android
6.0
|
完整支持
不支持
兼容性未知
见实现注意事项。
Notification