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>
<rdar://problem/6201382>
See also: <http://trac.webkit.org/projects/webkit/changeset/40371>.
ap, What was the reasoning behind that change? It seems like we want to match Firefox's behavior for window.close().
That change was actually made in an effort to match firefox.
> That change was actually made in an effort to match firefox. Awesome. What else is left to do to match their policy?
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!