Search code examples
firefox-addonelementxul

How do I retrieve an XUL element’s actual width and height?


I wanna get the actual width of a <xul:hbox> element for presentation. How can I get it? I see HTML element has offsetWidth attribute but I can't find this attribute in XUL element


Solution

  • Using element.getBoundingClientRect() or the older element.boxObject.width.