This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes window.close in Firefox 13 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "window.close in Firefox 13" Watch "window.close in Firefox 13" New topic
Author

window.close in Firefox 13

Skanda Raman
Ranch Hand

Joined: Mar 21, 2008
Posts: 205

I have a requirement to close my application tab when clicked on a close link. After google i came to know that Firefox do not close window through window.close until it is opened by the the script.

Hence i tried below script.



Now on clicking close link, I get blank page. The tab is not getting closed.

I tried adding the below script, but still the same.

netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");

Please guide me in resolving this problem


Skanda
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63229
    
  69

You cannot close a window/tab you did not open. Opening a new window and closing it isn't going to accomplish closing the parent.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Skanda Raman
Ranch Hand

Joined: Mar 21, 2008
Posts: 205


So this means that I would need to open a window like popup and then will be able to close it. Is this understanding correct?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63229
    
  69

If you want to be able to close it, you must open it.

How would you like it if any old web page you visited started closing windows on you? It's not your browser, it's the users. Don't mess with it.

Please read InterfaceDesignersRule1
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: window.close in Firefox 13
 
It's not a secret anymore!