I need a way to close the browser (not a pop up) using Javascript. Is it possible?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the window isn’t opened by some JavaScript code from your own domain, then you can’t close it in a crossbrowsercompatible way using JavaScript. Only in MSIE you can use
window.close(), but this will generate a warning which is however workaroundable by callingwindow.open('', '_self', '');beforehand. Still, this won’t work in Firefox and other decent browsers. And with a good reason. You shouldn’t forcibly close windows which the enduser opened itself. This is Bad User Experience.