Is it possible to close a tab via JavaScript?
For example, I have redirected user from email to my page, then I need to open pop-up window and close the tab I have redirected user to.
Does window.close()
work only for windows created with JavaScript? Or is it possible to modify tab, so that becomes a popup window?
window.close() is working only for windows created inside javascript?
window.close
should also work for new windows your page has created using target="_blank"
. Other than that, there is no way to close the current window or tab programmatically. As far as I know, what you want to do - closing an original window that you have not opened - is impossible.
No. You can only control child windows created inside a parent window.
"Is it possible to modify tab, so that it's become popup window?" Only if you have access to the page where it is created.
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