• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Firefox 3.5 Browser window close using javascript

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello ranchers,

Iam developing a web application using J2EE, Javascript technologies. In my application i have a signout button in every page to allow user to signOff from the application including closing the browser window.

I used the following code to close the browser window, below code works fine in IE7+ but unfortunately does not work in Firefox 3.5.



After goggling i realized that, in Firefox, browser windows opened only through javascript (using window.open) can be closed pro-grammatically. So i found that below code is a solution for this. But above code doesn't work from firefox 3.5. Any alternate solution for this ?

Any help is really appreciated. Thanks in advance for your time and attention.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you did not open the window, you should not be allowed to close it.

What you are trying to exploit is bugs in the browser, and hopefully the bugs have been patched, hence why it does not work.

Eric
 
Rancher
Posts: 377
Android Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,

Your answer is here stack overflow question, it works but as you will still see you get a security warning from Firefox before it continues with the operation.

I agree with what Eric says though, you should not be doing this.

Sean

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic