Using the following javascript/html code: <form><input type="button" value="Close Window" onClick="javascript:self.close();"></center></form> Safari will close a window, but only when that Window is not a tabbed window. When you have this code in a window that is a tab, pressing the button does nothing.
JavaScript can only close windows it opened, and since it can't open a tab without user interaction, it can't close tabs either. It would be interesting to have support for an "_tab" target, though, that would open a new tab (as "_blank" opens a new window).
The behavior in Firefox is that this Javascript will close a page (whether it is a free standing Window or a tab) without any issues. IE7 will close the page as well (again, whether a free standing Window or tab), but offers up a confirmation dialog before it will close. In each of these circumstances, the page/tab with the containing code is not a page that was opened by Javascript, but rather, by clicking through a link or landing on a page after submitting a form. I agree that it would be nice to have a "_tab" target, to bring Safari inline with other browsers behavior (and make it more compatible with today's web apps), the behavior should be changed to mirror Firefox/IE in that this javascript will close the Window, regardless of whether it is a free standing Window or a tab.
Created attachment 17671 [details] test case Same test, as an attachment.
I cannot reproduce this issue with Safari 3.0.4 or TOT on Tiger or Leopard. I've been opening two tabs with the test case, and clicking the Close button - it worked fine. I suspect a conflict with a Safari extension - do you have any installed?
(In reply to comment #4) > I cannot reproduce this issue with Safari 3.0.4 or TOT on Tiger or Leopard. > I've been opening two tabs with the test case, and clicking the Close button - > it worked fine. > > I suspect a conflict with a Safari extension - do you have any installed? > I also cannot reproduce the reported problem in WebKit r39474.
Still valid as of webkit-1.1.15.1 as used by epiphany-2.28.0 or midori-0.1.10. Duplicate of bug #13474 IMHO