Everytime a page receives a websocket event, it will play a notification sound. The problem is if user has 10 of these tabs open, all 10 tabs will play the sound.
So is there anyway to run this code only once, among all tabs, without modifying server-side code?
socket.on('notification', function(){
playSound(); // this will run on every tab, which is annoying
});