Alerting user if they have multiple browser tabs/windows open

We have an in-house application that our contact center uses to log activities.  It uses a web socket to relay information from our telephony system and all of that works quite well.   The only issue we are currently facing is that users tend to right click and open some of the web screens in a new tab, which ends up confusing them because session variables get overwritten by the new activity in the new tab and the web socket alerts are going all over the place.

Is there some method I can use to pop an alert to the user if they open a new tab while they already have a session active?   It won't stop them from running amuck, but at least we have done our due diligence by telling them that they shouldn't be doing what they are doing.

Jorge Rodrigues wrote:

Hello Josh,


Hope this helps: https://stackoverflow.com/questions/20087368/how-to-detect-if-user-it-trying-to-open-a-link-in-a-new-tab


Jorge Rodrigues

I don't know that this is really the solution I want to use as it basically keeps users from being able to use a right click in general.   There are valid use cases for right clicking  (pasting data in search fields, or copying from Datagrids)

I guess what I'm really wondering is if there is a function in OS to see if the user is already signed in and has an active session?    Then I could add a check to the prep of the screens and alert the user that they "Shouldn't" be opening multiple tabs.


Circling back to this in case anyone has new suggestions.   I cannot block right clicks via Javascript because we have legitimate use cases for that.   However we are seeing that some users sign into the application and then forget they have signed in, and open a new browser tab  (or a new browser instance) and since they have an active session that sessionID is the same between tabs/browsers.


So they might do some work in tab A and then flip to B but those session variables are now out of date because the changes on tab A clobbered them.  Basically I am looking for a way to detect on page load whether the User has a currently active session either in another browser (Firefox and Chrome for example) or two tabs in the same browser.   Then alert them that they may experience issues if they proceed.