Any way to identify browser tab in JavaScript?
SessionStorage is per tab/window, so you can define a random number in sessionStorage and get it at first if exists: var tabID = sessionStorage.tabID ? sessionStorage.tabID : sessionStorage.tabID = Math.random(); UPDATE: In some cases, you may have same sessionStorage in multiple tabs (e.g. when you duplicate tab). In that case, following code may help: var … Read more