html - Cross-window/tab in-browser notifications with JavaScript -
i working website having chat functionality (think facebook chat).
i'd play notification tone when new message arrives. however, user may have multiple tabs opened , message arrives multiple tabs, chat session multiplexed across different browser tabs/windows.
how determine
if browser has many tabs (windows) open same website
when new message arrives of tab(s) should play sound effect
i aware of notifications api, i'd solve problem in backwards-compatible manner. if there related javascript libraries know them.
you can use localstorage such purposes. data in localstorage shared between windows (tabs or iframes) same origin. can notify application changes in localstorage.
see iwc library. think tasks.
Comments
Post a Comment