• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

window.close in Firefox 13

 
Skanda Raman
Ranch Hand
Posts: 205
Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Skanda Raman
Ranch Hand
Posts: 205
Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Pie
Posts: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic