Summary: | javascript:self.close();" close window javascript doesn't work when window is a tab | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Theodore Lee <theodorewlee> | ||||
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED WORKSFORME | ||||||
Severity: | Normal | CC: | ap, tvignaud, webkit | ||||
Priority: | P2 | ||||||
Version: | 523.x (Safari 3) | ||||||
Hardware: | Mac | ||||||
OS: | OS X 10.5 | ||||||
Attachments: |
|
Description
Theodore Lee
2007-11-28 12:01:34 PST
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 |