I use SignalR to show new mail notifications dynamically. I've recently realized that if there are multiple tabs for the same domain, then the concerned function gets called as many times as the number of the tabs. So for instance, I open the application in IE and login as Brian. Then I open the same application in Chrome in 3 tabs and login as Kevin. When Brian sends mail to Kevin, the script that is responsible for incrementing the number of new mails is called 3 times. Has anyone come up with a solution for this?
Asked
Active
Viewed 112 times
1 Answers
1
Each tab is considered a separate connection for SignalR and hence you get multiple messages.
You can take inspiration from this.
For more details visit follow another SO question Javascript; communication between tabs/windows with same origin