If you call showModalDialog on a calling page, the window.returnvalue value that you set on the dialog page doesn't get passed back to the calling page. See the attached files for an example.
Created attachment 20093 [details] Page that calls showModalDialog This page depends on the BrowserPicker.html attachment to be in the same directory.
Created attachment 20094 [details] Page called by showModalDialog (the dialog) This page depends upon the DialogTest.html file previosly attached
Created attachment 20095 [details] Page that calls showModalDialog (using Bugzilla url) Replaced (browerpicker.html) parameter in showModalDialog call w/ bugzilla attachment url (http://bugs.webkit.org/attachment.cgi?id=20094), so you can test on the bugzilla site.
Note that this bug is Windows-only.
In Radar, <rdar://problem/5825338>
Verified in Safari 3.1 that this works ok on the Mac.
After a little debugging, this is definitely a Safari issue, not a WebKit issue. <rdar://5825338> will continue to track this issue. Thanks for filing the bug report!
Here's a little more detail about what I discovered: The return value from showModalDialog is getting passed back to the calling script. The call to alert() is what's failing in some cases. Scripts relying on showModalDialog should be able to get the return value. <rdar://5825338> will track the problematic interaction between showModalDialog() and alert().
Created attachment 20143 [details] Testcase that doesn't use alert() to display the return value Here's a testcase that proves the return value from showModalDialog is getting returned to the calling script. Instead of calling alert() we insert the value into the page.