XUL (// ZOOL), which stands for XML User Interface Language, is a user interface markup language developed by Mozilla. XUL is implemented as an XML dialect, enabling graphical user interfaces to be written in a similar manner to web pages.
|Paradigm||Declarative (markup language)|
In the past, Firefox permitted add-ons to extensively alter its user interface via custom XUL code, but this capability was removed in Firefox 57 and replaced with the less-permissive WebExtensions API. (Three forks of Firefox still support the legacy capability: Pale Moon, Basilisk, Waterfox.)
XUL has no formal specification and does not inter-operate with non-Gecko implementations. However, it uses an open-source implementation of Gecko which Mozilla tri-licensed under the GNU GPL, GNU LGPL, and MPL until Gecko changed to GPL-compatible, MPL 2.0.
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
- window, page, dialog, wizard, etc.
- label, button, text box, list box, combo box, radio button, check box, tree, menu, toolbar, group box, tab box, colorpicker, spacer, splitter, etc.
- Box model
- box, grid, stack, deck, etc.
- Events and scripts
- script, command, key, broadcaster, observer, etc.
- Data source
- template, rule, etc.
- overlay (analogous to SSI, but client-side and more powerful, with higher performance), iframe, browser, editor, etc.
While XUL serves primarily for constructing 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, 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[which?] 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.
As Gecko provides the only full implementation of XUL, such applications remain inaccessible to users of browsers not based on Mozilla. Mozilla-programmers sometimes refer to XUL applications running locally as chrome.
Other applications using XUL include:
- The ActiveState Komodo IDE uses XUL as well as the Open Komodo project announced in 2007.
- The Nightingale and Songbird music-players and Miro video-player all use built-in XUL.
- The Elixon WCMS/XUL Content management system uses exclusively remote XUL, thus overcoming some of the aforementioned limits of remote unprivileged XUL documents.
- The developers of the Celtx media pre-production application used XUL.
- The Flickr Uploader was built using XUL, and source code is available under GPLv2.
- Kiwix, the offline Wikipedia-viewer
With the release of Firefox 4, support for remote XUL was disabled by default, due to security concerns. Loading an XUL page via HTTP would now display an error unless the domain was added to a hidden whitelist.
The villain of the 1984 film Ghostbusters was a deity called Zuul who possesses the character Dana Barrett and declares, "There is no Dana. There is only Zuul". The creators of XUL, which is pronounced the same as Zuul, made the slogan "There is no data. There is only XUL!", part of which became the XML namespace.
This example shows three 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 3...." xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <vbox> <button id="yes1" label="Yes"/> <button id="no1" label="No"/> <button id="maybe1" label="Maybe"/> </vbox> </window>
- "Gecko FAQ". Mozilla Developer Center. Mozilla Foundation. 2008-03-15. Retrieved 2009-03-26.
- Firefox 57 release notes
- Kev Needham (2015-08-21). "The Future of Developing Firefox Add-ons". blog.mozilla.org. Retrieved 2018-04-02.
- "Pale Moon future roadmap". Pale Moon. Retrieved 2018-04-02.
- "Pale Moon team releases first version of Basilisk browser". ghacks.net. 2017-11-17. Retrieved 2018-04-02.
- "Waterfox, Its Legacy and Looking to the Future". Waterfox blog. 2018-04-28. Retrieved 2018-06-20.
- Mozilla Foundation. "Mozilla Code Licensing". Retrieved 2007-09-17.
- "The Joy of XUL". Mozilla Foundation. 2007-09-09. Retrieved 2009-03-26.
- 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 0-596-10243-7. Retrieved 2008-03-04.
- Getting your stuff onto Flickr
- "Firefox 4 for developers".
- Ghostbusters clip
- Mozilla XML Namespace
- The Box Model - XUL | MDN. Developer.mozilla.org (2012-12-16). Retrieved on 2014-03-28.