Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do Stack Overflow desktop notifications work?

Perhaps this is a fairly big and ambiguous question:

In the Stack Overflow chatrooms, there is a button to "enable desktop notifications," which will show something in the system tray when someone replies to you.

By what mechanism does this work? It's always made me curious.

How does a website access the system tray?

like image 232
corvid Avatar asked May 11 '14 15:05

corvid


People also ask

What do desktop notifications do?

Desktop notifications create a popup message each time an inbound call is received. Popup messages provide both a visual and audio notification of an inbound call and appear even when the browser is minimized.

How do I get stack overflow notifications?

Email notifications are now tied to your global inbox. To turn on email notifications, open your profile page by clicking your name as it appears at the top of any Stack Exchange site, and look for the “preferences” option at the top.

What is stack overflow used for?

Founded in 2008, Stack Overflow is a question-and-answer website, primarily used by those learning how to code, or who want to share knowledge or collaborate with others.


1 Answers

It uses the Notification object (i.e. var n = new Notification("Hello");) to provide local notifications on a per-website basis. Each browser implements the standard differently (see Chrome, Firefox, and Safari), but they all operate essentially the same way, sending notifications based on the permissions they have (window.Notification.permission), which can be default (hasn't been asked, in which case you would window.Notification.requestPermission();), granted, or denied. Opera and Internet Explorer do not support desktop notifications at this time.

like image 102
AstroCB Avatar answered Sep 30 '22 12:09

AstroCB