[Project_owners] How to focus <dialog/> ?
waymost at gmail.com
Sat Jan 28 09:13:57 EST 2006
I use the code below for my own options dialog, and I've never had a problem
var optionsWindow = ForwardFork.mediator.getMostRecentWindow
// if its open, focus it; otherwise, open it
if (optionsWindow && !optionsWindow.closed)
else optionsWindow =
Basically, you have to make sure a window (or dialog) )exists and that it
isn't closed. Then, based on that, you decide whether to refocus an open
dialog or open a new one.
On 1/28/06, Eric H. Jung <grimholtz at yahoo.com> wrote:
> I asked this question here
> http://forums.mozillazine.org/viewtopic.php?t=373278 but that didn't
> I'm using this code to focus/activate/bring-to-top both <window/> and
> <dialog/> elements:
> It works if getMostRecentWindow() returns a <window/>, but if it
> returns a modal <dialog/>, I get this exception:
> "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)
> [nsIDOMWindowInternal.focus]" nsresult: "0x80004005
> I'm using windowtype="passwordmaker" as a dialog attribute. Anyone know
> what I'm doing wrong?
> Thank you,
> Eric Jung
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> Project_owners mailing list
> Project_owners at mozdev.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Project_owners