Push.js是一款跨浏览器的桌面通知插件,如果用户的浏览器不支持,则返回使用旧的实现。推送是启动和运行Javascript桌面通知的最快方式。作为官方规范的一个新添加,NotificationAPI允许Chrome、Safari、Firefox和IE 9+等现代浏览器将通知推送到用户的桌面。Push作为该API的跨浏览器解决方案,如果用户的浏览器不支持新的API,则返回使用旧的实现。
世界上最通用的桌面通知框架达。
![]() |
---|
创建使用:
Push.create('Hello World!')
define(['pushjs'], function (Push) {
Push.create('Hello World!');
});
Push.count();
关闭通知:
Push.create('Hello World!', {
tag: 'foo'
});
// Somewhere later in your code...
Push.close('foo');
var promise = Push.create('Hello World!');
// Somewhere later in your code...
promise.then(function(notification) {
notification.close();
});
Push.clear();
官网地址 :https://pushjs.org/#
GitHub 地址 :https://github.com/Nickersoft/push.js
Gitee 地址:https://gitee.com/mirrors/push-js