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

Binding XBL to HTML

2 views
Skip to first unread message

ryan

unread,
Aug 18, 2009, 7:06:40 PM8/18/09
to
I've just discovered XBL and I was interested in extending some of the
XUL bindings packaged with Firefox and binding them to HTML elements
in a web page. An example use case would be adding autocomplete to an
arbitrary text input on an html page. I want to do this as an
extension.

Is this possible? I've experimented a little bit and it seems like it
kind of works but it's a little problematic. For example, the binding
completes successfully but a lot of the expected properties are null
and this leads to a lot of errors. I am doing the binding after the
html page loads using addBinding inside of my extension's code.

var activeElement = window.content.document.activeElement;
window.content.document.addBinding(activeElement, 'chrome://atlasbar/
content/autocomplete.xml#autocomplete');

Should I somehow bind it before the page loads? Will it make a
difference? How can I accomplish this?

Philip Chee

unread,
Aug 19, 2009, 11:10:12 AM8/19/09
to

We (Flashblock) use CSS and the -moz-binding rule to bind XBL to
specific html elements. e.g.

object[type="application/x-shockwave-flash"]
{ -moz-binding: url("chrome://flashblock/content/flashblock.xml#flash")
!important; }

Phil

--
Philip Chee <phi...@aleytys.pc.my>, <phili...@gmail.com>
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.

Boris Zbarsky

unread,
Aug 23, 2009, 3:44:50 PM8/23/09
to
ryan wrote:
> Is this possible? I've experimented a little bit and it seems like it
> kind of works but it's a little problematic. For example, the binding
> completes successfully but a lot of the expected properties are null

What properties are you expecting, and on what?

-Boris

0 new messages