谷歌chrome浏览器桌面提醒 webkitNotifications
原创:
//点击时开启提醒
$(".message_alert").toggle(function(){
$(".message_alert_tip").html("关闭提醒");
$(".message_alert").find("img").attr("src","public/images/bell_open.png")
initNotificatoin(); //打开浏览器开启桌面提醒询问
},function(){
$(".message_alert_tip").html("开启提醒");
$(".message_alert").find("img").attr("src","public/images/bell_close.png")
alert("要关闭桌面提醒,请设置弹框窗口的右上角按钮");
})
//调用弹出框
systemNotify(icon,title,content) ;
//打开系统消息
function initNotificatoin(){
if (window.webkitNotifications) {
window.webkitNotifications.requestPermission();
}else{
alert("您的浏览器不支持桌面提醒,请使用谷歌浏览器");
}
}
//系统消息
function systemNotify(icon,title,content) {
if (window.webkitNotifications) {
if (window.webkitNotifications.checkPermission() == 0) {
var icon="public/images/service.png";
var popup = window.webkitNotifications.createNotification(icon, title, content);
popup.ondisplay = function(event) {
setTimeout(function() {
event.currentTarget.cancel();
}, 5000);
}
popup.show();
} else {
window.webkitNotifications.requestPermission();
return;
}
}
}
谷歌chrome浏览器桌面提醒 webkitNotifications的更多相关文章
- 在 Ubuntu 16.04 中安装谷歌 Chrome 浏览器
进入 Ubuntu 16.04 桌面,按下 Ctrl + Alt + t 键盘组合键,启动终端. 也可以按下 Win 键(或叫 Super 键),在 Dash 的搜索框中输入 terminal 或&q ...
- Ubuntu 16.04下安装64位谷歌Chrome浏览器
1.进入 Ubuntu 16.04 桌面,按下 Ctrl + Alt + t 键盘组合键,启动终端. 也可以按下 Win 键(或叫 Super 键),在 Dash 的搜索框中输入 terminal 或 ...
- CentOS 7 使用 Yum 软件源安装谷歌 Chrome 浏览器
Google Chrome是一款由 Google 公司开发的网页浏览器,新版的 Chrome 浏览器使用的是 Blink 内核,具有运行速度快,稳定的特性.Chrome 能够运行在 Windows,L ...
- 如何解决谷歌Chrome浏览器空白页的问题
如何解决谷歌Chrome浏览器空白页的问题 谷歌Chrome浏览器突然不打开任何网页,无论是任何站点(如http://www.baidu.com), 还是Chrome浏览器的设置页面(chrome ...
- Ubuntu 16.04中安装谷歌Chrome浏览器
1.进入 Ubuntu 16.04 桌面,按下 Ctrl + Alt + t 键盘组合键,启动终端. 2.在终端中,输入以下命令: sudo wget https://repo.fdzh.org/ch ...
- 谷歌chrome浏览器被毒霸上网导航www.uu114.cn劫持 chrome://version命令行被篡改
问题描述 win10系统更新, 谷歌chrome浏览器打开后自动跳转到被劫持的网站.我的被hao123劫持, 瞬间对hao123的好感度下降浏览器输入chrome://version 可以看到“命令行 ...
- 谷歌Chrome浏览器开发者工具的基础功能
上一篇我们学习了谷歌Chrome浏览器开发者工具的基础功能,下面介绍的是Chrome开发工具中最有用的面板Sources.Sources面板几乎是最常用到的Chrome功能面板,也是解决一般问题的主要 ...
- 谷歌chrome浏览器和火狐firefox浏览器自带http抓包工具和请求模拟插件
谷歌chrome浏览器自带http抓包工具 chrome://net-internals/ 谷歌chrome浏览器http请求模拟插件:postman 火狐http请求模拟插件:httprequest ...
- Ubuntu小技巧——怎样安装谷歌Chrome浏览器
对于刚刚开始使用Ubuntu并想安装谷歌Chrome浏览器的新用户来说,本文所介绍的方法是最快捷的.在Ubuntu上安装谷歌Chrome的方法有很多.一些用户喜欢直接在谷歌Chrome下载页面获得 d ...
随机推荐
- flashback database 基本介绍一
flashback database 整个架构包括一个进程recover writer (rvwr)后台进程,flashback database log 日志和flash recovery area ...
- [Hive - LanguageManual ] Windowing and Analytics Functions (待)
LanguageManual WindowingAndAnalytics Skip to end of metadata Added by Lefty Leverenz, last edi ...
- Codeforces 377
简单说一下. A 搜索出任意一个剩余细胞个数的联通块.剩下的填X. B 二分加贪心加数据结构. /* * Problem: * Author: Shun Yao */ #include <str ...
- HDU ACM Eight
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1043 解题背景: 看到八数码问题,没有任何的想法,偶然在翻看以前做的题的时候发现解决过类似的一道题,不 ...
- JSP学习初体验
JSP简介: 1)JSP--Java Server Pages 2)拥有servlet的特性与优点(本身就是一个servlet) 3)直接在HEML中内嵌JSP代码 4)JSP程序由JSP Engin ...
- POJ 1287 Networking (最小生成树)
Networking 题目链接: http://acm.hust.edu.cn/vjudge/contest/124434#problem/B Description You are assigned ...
- Contest 7.23(不知道算什么)
Problem A URAL 1181 Cutting a Painted Polygon 题目大意就是说有一个N边形,让你做N-3条边,让他们的每个三角形的三个顶点颜色都不相同. 这里有一个引理 ...
- HDU 4463 Outlets (最小生成树)
题意:给定n个点坐标,并且两个点已经连接,但是其他的都没有连接,但是要找出一条最短的路走过所有的点,并且路线最短. 析:这个想仔细想想,就是应该是最小生成树,把所有两点都可以连接的当作边,然后按最小生 ...
- java functional syntax overview
Defining a Functional Interface @FunctionalInterface public interface TailCall<T> { TailCall&l ...
- input type=“submit”屏蔽自带的提交事件
<p><input type="submit" class="submit" value="确认支付" onclick=& ...