> I don't see your implementation of addref/release/queryinterface here. Are
> you using NS_IMPL_ISUPPORTS1 or some hand-rolled code to implement those
> methods?

I'm using NS_DECL_ISUPPORTS in the header, but as you sais, I didn't
implement these methods.

> This code is definitely incorrect. You've declared a
> nsCOMPtr<MyBrowserProgressListener> ml; but you haven't actually *created* a
> MyBrowserProgressListener. Did you perhaps mean:
>
> nsCOMPtr<MyBrowserProgressListener> ml = new MyBrowserProgresListener();
>
You are right.

> Then you try to get a weak reference to your listener. I'm not sure why
> you're trying to do this, but your MyBrowserProgressListener class doesn't
> implement nsISupportsWeakReference and so do_GetWeakReference will
> undoubtedly fail, leaving `listener` null. The typical and recommended way
> to implement nsISupportsWeakReference is to inherit from
> nsSupportsWeakReference and make sure your QueryInterface implementation
> lists nsISupportsWeakReference.

I want to test if webprogresslistener is that I need.
I want to execute some javascript in the html page after load it
completly, and if is it possible, send with javascript a message to my
gtk embedded browser application to close the browser and destroy the
gtk window.

What is the best way to do this?

- Blaine-
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to