javascript - Get users' attention when browser is minimized (cross-browser desktop notifications?) - Stack Overflow

I'm working on a browser-based application that needs to be able to get users' attention when

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

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).

Here are the things I've looked at:

  • Are there any JavaScript library for cross browser desktop notification?
  • Make browser window blink in task Bar

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.

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>

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

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

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).

Here are the things I've looked at:

  • Are there any JavaScript library for cross browser desktop notification?
  • Make browser window blink in task Bar

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.

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>

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

Share edited May 23, 2017 at 10:34 CommunityBot 11 silver badge asked Oct 21, 2011 at 21:38 SologoubSologoub 5,3526 gold badges39 silver badges66 bronze badges 2
  • 2 People hate popups because they contaminated the entire web at one point. All major browsers build in ways to automatically eliminate them. Most anti-virus software also has plugins to eliminate popups. So, the only way to do this is inherently not web-like. – evan Commented Oct 21, 2011 at 23:05
  • Thank you, Evan. I definitely share same sentiment from the user perspective. Since the application I'm working on is B2B, we have a bit more flexibility when it es to dictating settings. So, if there any suggestions that trigger pop-up blockers or other built-in browser security features that can be turned off by the user, that would be acceptable for this purpose. – Sologoub Commented Oct 21, 2011 at 23:11
Add a ment  | 

3 Answers 3

Reset to default 0

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.

Here's the documentation on it: http://code.google./chrome/extensions/notifications.html

As old as it is: Here is some new stuff might solve the problem in ~> IE9

Use window.extern.msSiteModeSetIconOverlay api call.

Here is a reference

http://www.codeproject./Articles/117115/Using-Overlay-Icon-API-to-Make-Client-Notification

If you can dictate that the users will turn off popup blockers, then have a "setup" page.

That page has instructions on how to turn off popup blockers for you site and their/all browsers. Preferably with images showing what to do. Most browsers give a notice that a popup has been suppressed with a way of adding the site to a "white list".

Then initiate a popup on that page when they click a button or perform some other action. Then they can just follow the instructions and turn off the popup suppression.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744913263a4600679.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信