|Internet media type||application/vnd.mozilla.xul+xml|
|Developed by||Mozilla Foundation|
|Opens with|| Mozilla Firefox|
|File formats category -|
XUL (pronounced zool ([zu:l]), XML User Interface Language), is an XML user interface markup language developed by the Mozilla project which operates in Mozilla cross-platform applications such as Mozilla Firefox and Flock.
Mozilla provides experimental XULRunner builds to let developers build their applications on top of the Mozilla application framework and XUL in particular.
Programmers typically define a XUL interface as three discrete sets of components:
- content: the XUL document(s), whose elements define the layout of the user interface
- skin: the CSS and image files, which define the appearance of an application
- locale: the files containing user-visible strings for easy software localization
XUL defines a wide range of elements, which roughly belong to the following types:
- Top-level elements
- e.g., window, page, dialog, wizard, etc.
- e.g., label, button, text box, list box, combo box, radio button, check box, tree, menu, toolbar, group box, tab box, color picker, spacer, splitter, etc.
- Box model
- e.g., box, grid, stack, deck, etc.
- Events and scripts
- e.g., script, command, key, broadcaster, observer, etc.
- Data source
- e.g., template, rule, etc.
- e.g., overlay (analogous to SSI, but client-side and more powerful, with higher performance), iframe, browser, editor, etc.
Mozilla added some common widgets —
<scale/> (sometimes called "slider"),
<textbox type="number"/> (spinbox), time and date pickers — during the Gecko 1.9 development-cycle.
While XUL serves primarily for creating the Mozilla applications and their extensions, it may also feature in web applications transferred over HTTP. The Mozilla Amazon Browser, a former XUL application of this type and well-known in its day, provided a rich interface for searching books at Amazon.com.
However, many of the powerful features of Mozilla such as privileged XPCOM objects remain unavailable to unprivileged XUL documents unless the script has a digital signature, and unless the user obtains grants of certain privileges to the application. Such documents also suffer from various limitations of the browser, including the inability to load remote XUL, DTD, and RDF documents.
Mozilla-programmers sometimes refer to XUL applications running locally as "chrome".
This example shows 3 buttons stacked on top of each other in a vertical box container:
<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="vbox example" title="Example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <vbox> <button id="yes" label="Yes"/> <button id="no" label="No"/> <button id="maybe" label="Maybe"/> </vbox> </window>
- ↑ Mozilla Foundation. "Mozilla Code Licensing". Retrieved on 2007-09-17.
- ↑ Firefox 3 for developers
- ↑ "Remote Application Development with Mozilla, Part 2: A Case Study of the Mozilla Amazon Browser (MAB)". Oreillynet. 2003-02-05.
- ↑ Feldt, Kenneth C. (2007). Programming Firefox: Building Rich Internet Applications with XUL. O'Reilly Media. pp. 76–77. ISBN 0596102437. Retrieved on 2008-03-04.
- ↑ http://www.xulplanet.com/tutorials/xultu/boxes.html