Re: Listening for alert boxes and accessing their DOM.
"Amit Saurav" <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Message-ID | <[email protected]> |
I was able to to listen to alerts and prompts using the
nsIWindowMediatorListener as follows:
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
wm.addListener(wmListener);
This listener has a onOpenWindow and onCloseWindow functions which is
fired every time an alert is displayed on the page. The problem is,
these function recieve an event object of the type XULWindow as
follows:
onCloseWindow: function(nsIXULWindow xulWindow){
//extract the DOM of this alert.
},
Is there a way to get the DOM of this XUL window?
Thanks...