Is there a way to detect if multiple browser tabs are opened of the same application.
Let's say i have www.test.com and i open 4 tabs of this website.
Is there a way to detect that multiple tabs are opened in JavaScript?
You cannot (and should not) do that. User can always just open use another browser or another computer to open another view onto the web site. So, basically you cannot ever prevent this. Your web-site should be able to handle multiple tabs viewing the same state.
Beside the answer of Mat, if you have a stylus (like Samsung Galaxy Note), you can also hover on the tabs [:D] button to see your open tabs count.
Highlight each worksheet tab you want to search by holding down the Ctrl key and clicking each tab you would like to search. Once each worksheet you want to search is highlighted, perform a Find, and all highlighted worksheets will be searched.
You can use my sysend.js library, it use localStorage to send messages between open tabs/windows. All to do is this code:
sysend.on('notification', function() {
sysend.broadcast('multiple');
});
sysend.on('multiple', function() {
// this will fire n-1 times if there are n tabs open if n > 1
alert('multiple pages');
});
sysend.broadcast('notification');
JSFIDDLE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With