When I call showModalDialog, window.dialogArguments is always undefined in the resulting window, even though I am passing in an object. This seems to be a regression because it works fine in Safari 419.3.
Thanks for the bug report, Dana! Could you provide a small test case demonstrating the issue? (A zip file containing two HTML files is fine.)
This URL seems to work for me: javascript:showModalDialog('javascript:alert(window.dialogArguments)', new Object()) I'm using Safari 3.0 (522.12) with a local debug build of WebKit r23737 on Mac OS X 10.4.10 (8R218).
Created attachment 15208 [details] Test case There are three files in the attached zip archive. DialogTest.html is the page to load in your browser with a "Click Me" button, which will load dialog.html in a modal window. The dialog.js file contains scripts run by dialog.html.
Strangely, that URL works for me as well! What's different?
Verified the attached test case (Attachment 15208 [details]) is a regression from Safari 2.0.4 (419.3) using Safari 3.0 (522.12) with a local debug build of WebKit r23748 on Mac OS X 10.4.10 (8R218). The test case needs further reduction to determine what's the difference between it and the one-liner in Comment #2.
<rdar://problem/5291173>
Regressed in <http://trac.webkit.org/projects/webkit/changeset/21367>. Dave's test case doesn't fail because it uses a javascript: URL so it doesn't load a new document into the newly-opened window. Here is a minimal failing test case: javascript:showModalDialog("data:text/html,<script>alert(dialogArguments)</script>", "PASS") I think the window's dialogArguments property is cleared as when the new document is loaded, now that every window starts out with an empty document.
Committed revision 24276.