Blog > A XUL Development Primer

July 3, 2006
Jay Goldman
We've started doing a fair bit of work with XUL, the Mozilla XML-based User Interface Language (there's a hint in there about a big upcoming announcement for the In-Between-Line-Readers among you). It's a really interesting environment to work in and really easy to learn since the entire Firefox browser is built in XUL and you can take it apart to study by example.

Now that we've clocked in a couple of days worth, we thought we'd share a few quick tips for those aspiring extension developers:

  1. You can use the DOM Inspector to look inside any element of chrome, the term Mozilla uses to refer to the browser's interface. Just open the inspector and use the URL to your chrome as the address - try chrome://browser/content/browser.xul to pick apart the browser's interface.
  2. You can use Venkman, the Mozilla JavaScript debugger, to step through you component's code too. If you're running Firefox (as opposed to Mozilla), you'll need to grab the Venkman Extension first, then launch it from the Tools menu. You won't see any chrome files at first, but they'll all show up if you turn off Exclude Browser Files in the Debug menu. Make sure that the component you want to debug is actually open or the files won't be listed (i.e.: if you're trying to debug a window, open the window once to get the files listed, set a breakpoint, close and reopen).
  3. This one's a little more obscure but might save you a whole bunch of hair pulling - you can load a stringbundle from inside an overlay on a window, and the bundle will be visible in the DOM Inspector, but you won't be able to access it using JavaScript. Seems to be a bug, though we couldn't find anything listed in BugZilla. You can insert the stringbundle in the JavaScript first and then insert it into the window, or you can just put the stringbundle into the window instead. If anyone has a better workaround, we'd love to hear it.
That's it for the first installment - stay tuned as we learn more :)
Posted by Jay Goldman on Monday, July 3, 2006 at 06:11 PM in Tech Geekery, XUL with tags , , Permalink3 comments

Comments

beltzner says:
For what it's worth, "chrome" is used by more than Mozilla to refer to area within an application that contains UI controls as opposed to content. We're hoping to improve our development tools, but if you ever want to know more, I'd recommend checking out the Mozilla Developer Centre or hopping onto irc.mozilla.org and asking questions in #developers or #firefox
Posted by beltzner on Wednesday July 12, 2006 at 2:11 AM
Michael Gall says:
Hey guys,

I'm currently doing a UI Review of the DOM Inspector and as part of that I'm doing some phone (skype) or email interviews of people who are using the DOM Inspector, and what they think and like about it. I'm especially interested in people who are doing XUL development as you guys are here.

If you'd like to help me out, please drop me a line.

Cheers,

Michael Gall
Posted by Michael Gall on Friday August 18, 2006 at 10:06 PM
Comment by a Radiant Core Team Member Jay Goldman says:
I've replied to Michael directly but just wanted to add a note here that if you're looking to contact us, the Contact page is a great way to do so!
Posted by Jay Goldman on Sunday August 20, 2006 at 6:20 PM

Post a New Comment

Please note that comments are moderated to prevent abuse of the comment system and will only appear after they have been approved by the author of this post. Use the "View Source" mode to edit HTML directly if you're into that kind of thing. We might not approve posts that are offensive or really off-topic, and we will definitely delete spam (and place nasty, nasty curses on the spammers).

Name
Email Address
Website
Comment