lukt1 wrote:
Hello!
How can I receive javascript events in my gecko embed app?
I would like to receive onChange javascript event and read html form
values(in my gecko embed app).
lukt1
On your class derived from nsIWebBrowserChrome take a look at
OnStateChange () and check your progressStateFlags for STATE_STOP...that
should be when the document has finished loading. Then you get hold of
the nsIDOMWindow by calling GetDOMWindow () from your aWebProgress
that was passed in nwIWebBrowserChrome::OnStateChange (). Then on the
nsIDOMWindow you just got, do a QueryInterface on it for your
nsIDOMEventTarget. Once you have that you call
nsIDOMEventTarget::AddEventListener () for any events you want to
receive notifications for.
Make sure to implement nsIWebBrowserChrome::HandleEvent () so you can
handle the events you just told Gecko to send you.
Hope this helps.
Niky Williams
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding