0

Am I really not able to have an Exit button to close out of all browsers? I have tried window.close() , self.close() and many more ways found all over the internet. They only work in IE which seems to be disappearing since Edge mode is coming out... Firefox and chrome act like the code does not even exist when it runs. Has anyone came across another method of closing with an exit button?

I have an index page with an exit button that I would like to automatically close the browser if chosen. Since it is my index page I do not have a window.open() command so it looks like window.close() is not an option?

Any ideas or suggestions of how to make my exit button close out the webapp?

<input class="btn btn-default" type="button" name="Exit" value="EXIT">

I am just hoping this issue has been resolved since I cannot find it on the web but have seen posts since 2004...

Dan Bracuk
  • 20,699
  • 4
  • 26
  • 43
Vicki
  • 1,386
  • 4
  • 15
  • 30
  • Please see here [link](http://stackoverflow.com/questions/57854/how-can-i-close-a-browser-window-without-receiving-the-do-you-want-to-close-thi) – hjardine Oct 01 '15 at 12:37
  • What is the use case for wanting to force the browser closed? As a user, it would anger me to no end if a web site tried to close my browser. – Scott Stroz Oct 01 '15 at 12:49
  • Well its an internal web app and they want it exactly the same as there old one – Vicki Oct 01 '15 at 12:51
  • which has an exit button the closes out of the app – Vicki Oct 01 '15 at 12:51
  • I found this on the link from @hjardine window.open('', '_self', ''); window.close(); – Vicki Oct 01 '15 at 12:51
  • but it still only works in IE and not firefox :/ – Vicki Oct 01 '15 at 12:52
  • Think it should work in Chrome etc.. just not Firefox apparently – hjardine Oct 01 '15 at 13:00
  • @Vicki This answer looks good [link](http://stackoverflow.com/a/16412945/5118056) – hjardine Oct 01 '15 at 13:01
  • Tested a few of the methods in that ^ link and they didn't work with Firefox and Chrome. Tell them that the close button is the red X in the top right corner. – Tony Hinkle Oct 01 '15 at 13:37
  • I'm not sure if it's still the case, but several years ago I learned that a browser window could only be closed by javascript if it was in fact opened by javascript. – Dan Bracuk Oct 01 '15 at 14:03
  • yea that's all I kept finding going back since 2004, I was hoping there would of been a solution or work around since people have been trying since then =/ but since no one is jumping on this question I am guessing its still the same answer – Vicki Oct 01 '15 at 17:16
  • @hjardine I get it to work in IE but I was hoping for FireFox specifically – Vicki Oct 01 '15 at 17:17
  • well all browsers that is but firefox and chrome are the main ones im having trouble with – Vicki Oct 01 '15 at 17:18
  • sorry @DanBracuk I added coldfusion tag incase that language had something written into it to do what I wanted since I am using CF also – Vicki Oct 01 '15 at 17:19

0 Answers0