Crypto加密

  • Crypto.subtle仅支持https

Notifications API系统通知api

1
2
3
4
5
6
7
8
9
10
11
12
13
14
// https://developer.mozilla.org/zh-CN/docs/Web/API/Notifications_API
function notification(title, content, iconurl) {
Notification.requestPermission().then(function(permission) {
if(permission == 'granted') {
var mynotification = new Notification(title, {
body: content,
icon: (iconurl||document.getElementById('meAvatar').src)
});
mynotification.onclick = function() {
mynotification.close();
}
}
});
}