Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
impress.rpc.createMaster = function() {
impress.rpc.masterTab = true;
impress.rpc.masterTabId = impress.rpc.tabId;
impress.rpc.masterTabKey = impress.rpc.tabKey;
localStorage['impress.rpc.master'] = impress.rpc.tabId;
impress.rpc.initializeDone();
};
impress.rpc.initializeConnection = function() {
if (!impress.rpc.initialized) {
impress.rpc.tabId = impress.rpc.getFreeTab();
impress.rpc.tabKey = 'impress.rpc.tab' + impress.rpc.tabId;
impress.rpc.heartbeat();
impress.rpc.heartbeatEvent = setInterval(impress.rpc.heartbeat, impress.rpc.heartbeatInterval);
localStorage['impress.rpc.newtab'] = impress.rpc.tabId;
global.addEventListener('storage', impress.rpc.onStorageChange, false);
}
var master = localStorage['impress.rpc.master'];
if (master) impress.rpc.setMaster(master);
else impress.rpc.createMaster();
impress.rpc.initializeDone();
};