Bug 20661
| Summary: | JavaScript can close a window | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Berend-Jan Wever <skylined> |
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | abarth, collinj |
| Priority: | P2 | Keywords: | HasReduction, InRadar |
| Version: | 312.x | ||
| Hardware: | PC | ||
| OS: | Windows Vista | ||
| URL: | http://skypher.com/SkyLined/Repro/Safari/Closer | ||
Berend-Jan Wever
JavaScript can close a window, even if it was not opened through JavaScript. This is done by closing an IFRAME within the page:
<BODY onload="go()">
<IFRAME name="target"></IFRAME>
</BODY>
<SCRIPT>
function go() {
oWin = window.open("about:blank", "target");
oWin.close();
}
</SCRIPT>
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Mark Rowe (bdash)
<rdar://problem/6201382>
Alexey Proskuryakov
See also: <http://trac.webkit.org/projects/webkit/changeset/40371>.
Adam Barth
ap, What was the reasoning behind that change? It seems like we want to match Firefox's behavior for window.close().
Brady Eidson
That change was actually made in an effort to match firefox.
Adam Barth
> That change was actually made in an effort to match firefox.
Awesome. What else is left to do to match their policy?
Brady Eidson
I can't find a thorough documentation of Firefox's window.close() policy, but that change definitely brought us closer.
And, in the process, fixed this bug!