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

Overlay or use script to modify binding

0 views
Skip to first unread message

Derrick Rice

unread,
Nov 16, 2009, 3:01:33 PM11/16/09
to
My goal is to add a single icon to the tabbrowser-tab binding which
defines the contents of a tab in firefox 3. The content is defined
as:

<content chromedir="&locale.dir;"
closetabtext="&closeTab.label;">
<xul:image xbl:inherits="validate,src=image" class="tab-icon-
image"/>
<xul:label flex="1" xbl:inherits="value=label,crop,accesskey"
class="tab-text"/>
<xul:toolbarbutton anonid="close-button" tabindex="-1"
class="tab-close-button"/>
</content>

I have made some progress in this by adding an event listener to the
tabbrowser for the 'TabOpen' event and adding a <image> element to the
<tab>. At the time that I do this, the anonymous children already
exist, and they are all displayed.

When the tab is moved by the user, only my icon is shown - the normal
bindings disappear. This is consistent with the documentation:
bindings that do not have insertion points will not be applied to
sites that have explicit children. However, it's obviously not my
intent.

Is it possible to effectively "overlay" a binding?

Is it possible to add anonymous content to a binding? I can access
elements of the XPL via getAnonymousElementByAttribute() but if I try
to add a sibling, it is added as an explicit element. This is due to
parentNode always evaluating to the binding site.

Neil

unread,
Nov 17, 2009, 7:39:13 AM11/17/09
to
Derrick Rice wrote:

>Is it possible to effectively "overlay" a binding?
>
>

You could extend the binding, but then again other extensions might be
trying to do the same thing...

--
Warning: May contain traces of nuts.

0 new messages