Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem encountered to detect the page load event during firefox extension development

40 views
Skip to first unread message

codeplay

unread,
Mar 19, 2009, 9:25:17 AM3/19/09
to dev-tech-...@lists.mozilla.org, dev-te...@lists.mozilla.org
Hi folks:
I'm writing a firefox extension which needs to detect html page load event,
I used "DOMContentLoaded" and "DOMFrameContentLoaded" event listener as
following:

...
appcontent.addEventListener("DOMContentLoaded", function(e){
f.onPageLoad.apply(f,[e,'DOMContentLoaded']);}, true);
appcontent.addEventListener("DOMFrameContentLoaded", function(e){
f.onPageLoad.apply(f,[e,'DOMFrameContentLoaded']);}, true);
...

Above code is ok for some pages, but for certain pages,
the "DOMContentLoaded" event is fired for many times. I cannot tell how the
pages are special, it seems they are using javascript to load some portion
of the page.

My question is, is there a robust way to detect the page load event? (fired
only once after the page content, may include or exclude the images, is
completely loaded)

Appreciate any hint or solution very much, thank you!

Regards,
codeplay

BenKeen

unread,
May 14, 2009, 5:34:51 PM5/14/09
to
I'm looking for the very same solution....!

- Ben

BenKeen

unread,
May 15, 2009, 1:34:57 PM5/15/09
to
For anyone else encountering this problem, this page may help:
https://developer.mozilla.org/En/Code_snippets:Progress_Listeners

- Ben

0 new messages