Md. Sabbir Ahamed Md. Sabbir Ahamed - 1 month ago 9
AngularJS Question

How to close browser all open tabs related to a specific domain while logout from any of those one tab using angular js

Suppose I logged in onto a web app like www.website.com and open multiple tabs of this domain in a single browser. It is possible on angular app that, if I logged out from any on those one tab, all others tab are related to this (www.website.com) domain will be closed automatically?

If possible what will be the best solution on angular or JavaScript?

Thanks in advance.

Answer

You can only close windows that you open yourself/using code. Which means you cannot programmatically close a window that the user opens. If you are opening a window using window.open() you can close that window using javascript using window.close(). But if a user is opening some window you can not close that window.