Bug 20661 - JavaScript can close a window
Summary: JavaScript can close a window
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 312.x
Hardware: PC Windows Vista
: P2 Normal
Assignee: Nobody
URL: http://skypher.com/SkyLined/Repro/Saf...
Keywords: HasReduction, InRadar
Depends on:
Blocks:
 
Reported: 2008-09-05 05:34 PDT by Berend-Jan Wever
Modified: 2009-01-29 18:40 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Berend-Jan Wever 2008-09-05 05:34:21 PDT
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>
Comment 1 Mark Rowe (bdash) 2008-09-05 17:41:05 PDT
<rdar://problem/6201382>
Comment 2 Alexey Proskuryakov 2009-01-29 14:36:37 PST
See also: <http://trac.webkit.org/projects/webkit/changeset/40371>.
Comment 3 Adam Barth 2009-01-29 15:53:38 PST
ap, What was the reasoning behind that change?  It seems like we want to match Firefox's behavior for window.close().
Comment 4 Brady Eidson 2009-01-29 16:56:06 PST
That change was actually made in an effort to match firefox.
Comment 5 Adam Barth 2009-01-29 18:11:12 PST
> That change was actually made in an effort to match firefox.

Awesome.  What else is left to do to match their policy?
Comment 6 Brady Eidson 2009-01-29 18:40:29 PST
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!