[Project_owners] Re: promptService.confirm(aWindow, ... issues
Michael Vincent van Rantwijk
mv_van_rantwijk at SPAMFREEyahoo.com
Wed Jun 15 10:36:21 EDT 2005
Michael Vincent van Rantwijk wrote:
> I have some problems with:
> result = promptService.confirm(aWindow, ...
> The problem is that I cannot use any browser window object for aWindow
> without getting the following error:
> Error: uncaught exception: [Exception... "Component returned failure
> code: 0x80004005
> (NS_ERROR_FAILURE) [nsIDOMWindowInternal.focus]" nsresult: "0x80004005
> location: "JS frame :: ... data: no]
> However, the prompt is displayed as a dependent window of aWindow and
> all bottons and button text are being displayed like they should. Also
> note that the error shows up on the JS console *after* I select one of
> the buttons.
> I also tried:
> result = promptService.confirmEX(aWindow, ... but he same error pops up.
> How can I prevent/work around this error?
> p.s. aWindow can be any chrome window, not the window that initiated the
I sort of fixed this error by moving the calls to
promptService.confirm() and promptService.confirmEX() into a new JS
function called doAsk(). I did this because I found out that using
aWindow.setTimout(doAsk,0) is a way of preventing the error, because it
than runs in the context of aWindow, but I can't use that.
The main reason for this is that I need the return values from
promptService.confirm() and promptService.confirmEX() and I don't know
how to solve that problem...so I've still a lot to learn, and can use
Is there another way to run doAsk() in the context of aWindow, without
using a aWindow.setTimeout? aWindow.doAsk() didn't work, or I did
something wrong, so... HELP !!!
More information about the Project_owners