I have an XPCOM dll where I am setting up DOM listeners in the hope of
catching the ::Load event for each page.  I have successfully established
the nsIDOMKeyListener as well as others, but nsIDOMLoadListener does not
seem to work, although the following AddEventListenerByIID succeeds;

   nsIDOMLoadListener *pListener = NS_STATIC_CAST(nsIDOMLoadListener *,
this);
   rv = mEventReceiver->AddEventListenerByIID(pListener,
NS_GET_IID(nsIDOMLoadListener));
   if( NS_FAILED(rv) ) ::MessageBox(NULL,"Failed to add
listener","ok",MB_OK);

I never get notification in the nsIDOMLoadListener::Load or
nsIDOMLoadListener ::Unload.  I used the code from nsDocShellTreeOwner as a
model for establishing the listener class from my xpcom dll.  Maybe there is
another way to employ IWebProgressListener?

also - I am using the latest Mozilla source - I am not trying this in
released NS 0.6 (or whatever)

Thanks - Tom McSherry



Reply via email to