aspose file tools*
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
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

Eshwar Prasad
Ranch Hand

Joined: Mar 21, 2008
Posts: 202
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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

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]
Eshwar Prasad
Ranch Hand

Joined: Mar 21, 2008
Posts: 202

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: 60059
    
  65

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 agree. Here's the link: http://aspose.com/file-tools
 
subject: window.close in Firefox 13
 
Similar Threads
Problem in window.close; page get requested again
to close an opener
from servlet wants to close the application
Firefox 3.5 Browser window close using javascript
Close Popup Window after download completes