views:

76

answers:

1

Hi All, I am trying to capture a page load event while developing a extension for firefox. I am using ProgressListeners for this. I cannot use the onLocation change event because it fires an event every time the user switches the tab. I just want to log every new page he has visited. OnProgressChange works for me, but this is fired multiple times per page. How do I log this for one entry per page. Is there any other event I need to listen to ?

Thanks in advance..

A: 

onProgressChange is used for notifications about progress, so of course it's called multiple times.

You see onLocationChange when the user switches tabs because you attach the progress listener to the tabbrowser, not to an individual tab.

You could try listening to (progress) events on all tabs -- start by dumping all events you get and pick either onLocationChange or onStateChange depending on what you need.

Nickolay