provide tab id

This commit is contained in:
Roland Gruber 2019-05-20 20:06:55 +02:00
parent 8186aed796
commit e5484ee833
1 changed files with 17 additions and 0 deletions

View File

@ -1111,6 +1111,23 @@ window.lam.html.preventEnter = function() {
});
}
window.lam.tabs = window.lam.tabs || {};
/**
* Returns the id of the current browser tab.
*
* @returns tab id
*/
window.lam.tabs.getTabId = function() {
var lamTabId = sessionStorage.getItem('lamTabId');
if (!lamTabId) {
var date = new Date();
lamTabId = date.getTime() + '-' + Math.floor(Math.random() * 10000000000);
sessionStorage.setItem('lamTabId', lamTabId);
}
return lamTabId;
}
window.lam.selfservice = window.lam.selfservice || {};
/**