Re: nsIDOMWindow::GetDocument() returning null on FF3
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <fad5d57d-383a-44da-ac31-73b0fcc60a72@s36g2000vbp.googlegroups.com> |
Hi Feng, Can you please let me know how do you get document using a nsIWebProgressListener. I am getting the document directly from nsIDOMWindow using GetDocument (). I see even though DOM is refreshed elementfrompoint () return the control which was from old DOM(before refresh). Regards Srinivas On Jan 16, 12:32 am, "[email protected]" <[email protected]> wrote: > I don't have the answer to your question. However, I do have an > observation or rather a question which is related. I am using FF3 as > well. What I found is the nsIDOMWindow I get from nsIWebBrowser might > now be the most current one for some reason. I understand nsIDOMWindow > changes during a load so I obtain it using a nsIWebProgressListener. > But even the one I get at the end of the progress might not be the > same one that the real DOM tree resides later on. This happens > randomly and most of them occur during the first load of a new browser > window. Note that my problem is a little bit different from yours > since I always get a non-null document out of it (just that it's not > the right one). > > Does anyone know how to obtain the nsIDOMWindow in a reliable way? > Which event should I listen to? Many thanks. > > Regards, > > Feng > > On Jan 7, 7:20 am, "Oliveiros Cristina" > > <[email protected]> wrote: > > Dear all, > > > Is it possible that this attribute returns null even though nothing wrong is reported by the return error code? > > > NS_FAILED() returns 0. > > > This situation never arisen on FF2 browser, but its starting to happen with ff3 on some pages.... > > > It seems that DOM Window Objects on FF3 all expose nsIDOMWindow2 interface. > > I am accessing GetDocument() through a nsIDOMWindow* pointer. > > > Can anyone please kindly help me on this? > > > Thanks a million in advance for your help > > > Best, > > Oliveiros