Reputation: 1871
I want to close all active tab except the current tab. Is this possible?
In my web site, when a user uses many tabs in same browser it fails. I want to close all tabs except the current one when any events triggered.
Here is a solution that I found:
function close_window() {
if (confirm("Close Window?")) {
close();
}
}
This will work but how can I access other tabs?
Upvotes: 1
Views: 3921
Reputation: 2173
You can't directly control other tabs. You could instead pass them information by writing to cookies or local storage and having all tabs monitor that space.
However, I think that if your site doesn't work when open in multiple tabs, you should be focusing on fixing that problem.
Upvotes: 2