Detect multiple tabs open in vanilla javascript
<script> // Broadcast that you're opening a page. localStorage.openpages = Date.now(); window.addEventListener('storage', function (e) { if (e.key == "openpages" ) { // Listen if anybody else is opening the same page! localStorage.page_available = Date.now(); } if (e.key == "page_available" ) { alert( "One more page already open" ); } }, false ); </script> You might need to read the following steps 2 or 3 times to grab the concept properly. When you open the 1 st ...