prettydiff / share-file-systems

Use a Windows/OSX like GUI in the browser to share files cross OS privately. No cloud, no server, no third party.
GNU Affero General Public License v3.0
140 stars 10 forks source link

OS Notification of text messages #112

Open prettydiff opened 3 years ago

prettydiff commented 3 years ago

This functionality is achieved in Windows 10. When a text message comes into the browser while the browser is not the active window it blinks orange in the taskbar. Unfortunately, I only know how to achieve this effect in Windows.

See: https://github.com/prettydiff/share-file-systems/blob/master/lib/terminal/server/osNotification.ts

I am looking for guidance to achieve a similar effect on other operating systems.

terrablue commented 2 years ago

Have you considered the Web Notifications API (https://caniuse.com/notifications)? If you're willing to forgo Safari iOS support, it might be a possibility.

I have also seen something like a notification count API that actually shows a small number next to the browser icon, but I can't find it at the moment.

terrablue commented 2 years ago

https://developer.mozilla.org/en-US/docs/Web/API/Badging_API

There we go. Though this hasn't seen much adoption beyond Chrome-like Windows/macOS.