On Thu, 18 Sep 2003 12:00:41 +0200, Piercarlo Slavazza wrote:
> C�dric wrote:
>> On Tue, 16 Sep 2003 01:20:26 -0700, piercarlo wrote:
>>
>>
>>> [...]
>>>My question is: how can I detect when a tab (with some page yet
>>>loaded) is taken to foreground (so I can change accordingly the
>>>content of my sidebar)? Is there some proper event to be used with
>>>addObserver()?
>>>More in general, where can I find a list with all the events?
>>>
>>>Thanks a lot!
>>>bye
>>>piercarlo
>>
>>
>> I'm not sure but you have to add a progressListener to the tab browser
>> object
>
> Ok. Do you have any idea of the way I can get a reference to that
> object? Always through XPCOM or whatever else?
>
> Thanks!
> piercarlo
in javascript you have to do that :
yourBrowser.addProgressListener(myProgressListener,
Components.interfaces.nsIWebProgress.NOTIFY_LOCATION);
// Progress Definition
var downloadProgressListener = {
onStateChange: function(webProgress, request, stateFlags, status)
{bla bla},
onProgressChange: function(webProgress,
request,curSelfProgress,maxSelfProgress,curTotalProgress,maxTotalProgress) {bla bla
...},
onLocationChange: function(webProgress,aRequest,location){bla bla},
onStatusChange: function(webProgress, request, status, message){bla
bla ..},
onSecurityChange: function(webProgress, request, state) {bla bla ...},
QueryInterface: function(iid) {
if(!iid.equals(Components.interfaces.nsIWebProgressListener) &&
!iid.equals(Components.interfaces.nsISupportsWeakReference)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return this;
}
};
and through XPCOM you should have to do something similar but I don't know
exactly what. Sorry, I hope my previous example in javascript help you.
if I have a time, I'll look for it.
Cedric