If you use window.showModalDialog to open your modal dialog, then according to MSDN , it looks like you can return a value from a modal dialog by setting the returnValue property in the window. It looks like it will work in Firefox too, based on the Mozilla documentation . In the dialog box, you must set the returnValue property:
window.returnValue = GetTheUrlThatWasTypedIn();
And then in the parent window, extract it into a variable when opening a modal dialog:
var theUrl = window.showModalDialog();
source
share