nmaier / extsdk

Lightweight Extension SDK
Mozilla Public License 2.0
9 stars 8 forks source link

Build and publish a nodeList from XUL file #4

Open xabolcs opened 9 years ago

xabolcs commented 9 years ago

While thinking and hacking with CustomizableUI.jsm from ExtSDK (#2), I wondered if there will be a loadNodesFromOverlay function, or just a map (generated by registerOverlay) containing all the nodes from the xul.

This could simplify building UI objects (especially toolbaritems) to a document.importNode.

Of course all this could be go to a utils.js next to main.js but I think it is enough to read once the overlay.xul. So I'm ok if this got a wontfix. :)

nmaier commented 9 years ago

If you need to refactor some code to create some functions reusable by registerOverlay and nay new toolbar button code, then I'm all for that. Right now registerOverlay just loads the overlay URL, cleans the DOM by removing white space text nodes and then maps any elements with an id into a map-like object.