How to get tab id from "DOMContentLoaded" event, Firefox

7 vues
Accéder directement au premier message non lu

Philipp Scholl

non lue,
3 nov. 2007, 16:10:4703/11/2007
à
Hi!
I have following problem:

I have attached a listener to "DOMContentLoaded" (fires when a web
page's html is fully loaded) to the <vbox> with id "appcontent". This
works like a charm, but now I'd need to get the id of the tab that the
page is loaded in.
I can't seem to get up via event.originalTarget.parentNode from the
event's .originalTarget (the #document) to the xul:notificationbox (the
one having the id I need like e.g. "panel123412413") that contains it.

One way this could be done would be by getting down from the event's
.currentTarget (which is "appcontent") to the opened tabs and identify
them by comparing the opened URL, but this wouldn't work if I had opened
the same page in two or more different tabs...

Does anybody have an idea how I could proceed?
Thanks & regards,
Phil

Mook

non lue,
3 nov. 2007, 20:38:2003/11/2007
à
Philipp Scholl wrote:
<snip>

> I can't seem to get up via event.originalTarget.parentNode from the
> event's .originalTarget (the #document) to the xul:notificationbox (the
> one having the id I need like e.g. "panel123412413") that contains it.

I believe <tabbrowser> has a getBrowserIndexForDocument; that should
help you get what you want, I think.


HTH

--
Mook
mook dot blargh

Philipp Scholl

non lue,
5 nov. 2007, 04:49:0705/11/2007
à
> <snip>

>
> I believe <tabbrowser> has a getBrowserIndexForDocument; that should
> help you get what you want, I think.
Thanks a lot, that was exactly what I was looking for!
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message