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

tab change event

6 views
Skip to first unread message

Axel Grude

unread,
Dec 19, 2009, 9:35:47 AM12/19/09
to
Hi,

is there an event that I can set up a listener for when another tab is
activated? I have a folder listener set up that reacts to the active
folder being changed:

mailSession.AddFolderListener(qfFolderListener,
Components.interfaces.nsIFolderListener.all);

but this event is not thrown when the active tab changes (which can
result in the folder tree selection changing as well)

thanks
Axel

Eric Jung

unread,
Dec 19, 2009, 6:56:05 PM12/19/09
to dev-ext...@lists.mozilla.org

Axel Grude

unread,
Dec 25, 2009, 2:42:07 PM12/25/09
to dev-ext...@lists.mozilla.org, eric...@yahoo.com

Hi Eric,

I tried that but there seem to be no events in thunderbird? Is there a
folder change event that is triggered by activaing a tab with a
different folder? Also which DOM element is the tabbrowser in TB, do you
think getElementById('tabmail') is the correct one?

var qfTabListener = {
mailTabSelected: function(evt){
qfLocalErrorLogger('mailTabSelected');
try {
QuickFolders.Util.logToConsole('event ' + evt);
if(QuickFolders)
QuickFolders.Interface.onFolderSelected();
}
catch(e) {
qfLocalErrorLogger(
"Exception in Item event - calling mailTabSelected: "
+ e)};
}
}

addTabEventListener: function() {
if (((QuickFolders.Util.Appver() < 3) &&
(QuickFolders.Util.Application()=='Thunderbird')))
return;
try{
this.tabContainer = document.getElementById('tabmail');
// also tried: tabbrowser // .tabContainer; // tabmail-container
//other events tried: "TabClose", "TabOpen"
document.getElementById('tabmail')
.addEventListener("TabSelect",
qfTabListener.mailTabSelected, false);
}
catch (e) {
this.tabContainer = null;
}
}
}

PS: not much editing possible at the moment, I am having trouble with my
internet at the moment my provider (three Ireland) gives me no bandwidth
at all (secure pages alway time out). An I will likely need 10 tries(*)
... until I can send out this message!

see also :
http://www.youtube.com/watch?v=d62jQ22w360
(Hitler gets 3 broadband)

(*)well let's see, this is the second try ... pressing send again.
connection timed out, ok third try ... Sending of message failed
again, 4th time...
failed, timed out - okay restart my routed ... 30 secs later .. dial PPP
.. another 20 secs... lets send again, 5th time...

Eric Jung

unread,
Dec 26, 2009, 6:48:51 AM12/26/09
to Axel Grude, dev-ext...@lists.mozilla.org
On Fri, Dec 25, 2009 at 2:42 PM, Axel Grude <axel....@gmaii.com> wrote:

> Eric Jung wrote:
> > On Sat, Dec 19, 2009 at 9:35 AM, Axel Grude <axel....@gmaii.com>
> wrote:
> >
> >> Hi,
> >>
> >> is there an event that I can set up a listener for when another tab is
> >> activated? I have a folder listener set up that reacts to the active
> >> folder being changed:
> >>
> >> mailSession.AddFolderListener(qfFolderListener,
> >> Components.interfaces.nsIFolderListener.all);
> >>
> >> but this event is not thrown when the active tab changes (which can
> >> result in the folder tree selection changing as well)
> >>
> >>
> >>
> > Hi,
> >
> > I think you want this:
> >
> >
> https://developer.mozilla.org/en/Code_snippets/Tabbed_browser#Detecting_tab_selection
> >
> > Eric
>
> Hi Eric,
>
> I tried that but there seem to be no events in thunderbird? Is there a
> folder change event that is triggered by activaing a tab with a
> different folder?

Sorry I don't know TB events.

> Also which DOM element is the tabbrowser in TB, do you
> think getElementById('tabmail') is the correct one?
>
>

I think you want getElementById('mail:3pane'). If not, use DOM Inspector to
get the ID of the one you want.

see also :
http://www.youtube.com/watch?v=d62jQ22w360
(Hitler gets 3 broadband)


Nice video! :)

Eric

Axel Grude

unread,
Dec 26, 2009, 1:43:47 PM12/26/09
to
>
>
>> Also which DOM element is the tabbrowser in TB, do you
>> think getElementById('tabmail') is the correct one?
>>
>>
> I think you want getElementById('mail:3pane'). If not, use DOM Inspector to
> get the ID of the one you want.
>
> see also :
> http://www.youtube.com/watch?v=d62jQ22w360
> (Hitler gets 3 broadband)
>
>
> Nice video! :)
>
Thanks, yes, its really that bad with Three Ireland.

I got the tabmail id from the DOM inspector (and I am pretty sure it is
a tabbrowser) the question is is it possible to listen for ALL events to
see if I can fish out a suitable one?

Axel

0 new messages