在浏览器最小化时获取用户的注意(跨浏览器桌面通知?) [英] Get users' attention when browser is minimized (cross-browser desktop notifications?)

查看:194
本文介绍了在浏览器最小化时获取用户的注意(跨浏览器桌面通知?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个基于浏览器的应用程序,当用户收到传入的事件(如邮件)时,即使用户已最小化浏览器,也需要能够吸引用户的注意。

I'm working on a browser-based application that needs to be able to get users' attention when the user receives an incoming event, such as a message, even if the user has minimized the browser.

搜索给了我一些好的结果,但没有跨浏览器或firefox的具体。我需要能够支持IE 7+和FF 3.6+(特定于用户群)。

Searching gave me some good results, but nothing cross-browser or firefox-specific. I need to be able to support IE 7+ and FF 3.6+ (specific to the user base).

这里是我看过的东西:

  • Are there any JavaScript library for cross browser desktop notification?
  • Make Browser Window Blink in Task Bar

到目前为止,我们使用一个简单的javascript警报来获取托盘图标闪烁,但是在尝试响应通知(总共3次点击,或33%的降级)时创建了额外的点击。

So far, we used a simple javascript alert to get the tray icon to flash, but that created an extra click in trying to respond to the notification (total of 3 clicks now, or a 33% degradation). Users are expected to do this 20-50 times a day, so it will get really annoying really quickly.

根据微软开发者网络提供的一个例子,我做了这个简单的原型,它适用于IE,但它是IE特定的,将不能在其他浏览器中工作:

Based on an example provided on Microsoft developers network, I made this simple prototype that worked well for IE, but it's IE-specific and will not work in other browsers:

<HTML>
<HEAD>
<TITLE>Popup Example</TITLE>
<SCRIPT LANGUAGE="JScript">
function timeMsg()
{
    var t=setTimeout("ButtonClick()",5000);
}

var oPopup = window.createPopup();

function ButtonClick()
{
    var oPopBody = oPopup.document.body;
    var myHeight = (window.screen.availHeight - 125);
    var myWidth = (window.screen.availWidth - 350);

    oPopBody.style.backgroundColor = "red";
    oPopBody.style.border = "solid black 1px";
    oPopBody.innerHTML = "Click outside <B>popup</B> to close.";
    oPopup.show(myWidth, myHeight, 300, 75);
}
</SCRIPT>
</HEAD>
<BODY>
<BUTTON onclick="timeMsg()">Display alert in 5 seconds</BUTTON>
</BODY>
</HTML>

非常感谢任何建议, p>

Any suggestions on how to make this experience better without using an executable installed locally are greatly appreciated!

推荐答案

我们最终只是使用Google Chrome桌面通知,要求我们的客户在IE中使用Chrome或Chrome Frame。

We ended up just going with Google Chrome Desktop Notifications and asking our clients to either user Chrome or Chrome Frame within IE. Notifications are augmented by playing a sound as an alert.

这是关于它的文档: http://code.google.com/chrome/extensions/notifications.html

这篇关于在浏览器最小化时获取用户的注意(跨浏览器桌面通知?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆