XUL
Paradigm | Declarative (markup language) |
---|---|
Developer | Mozilla Foundation |
Implementation language | C++ |
Platform | Gecko |
OS | Cross-platform |
License | MPL |
Filename extensions | .xul MIME type: application/vnd.mozilla.xul+xml |
Website | Official documentation[dead link ] |
Major implementations | |
Mozilla | |
Influenced by | |
HTML, XML |
XUL (/ˈzuːl/ ZOOL), which stands for XML User Interface Language, is a user interface markup language developed by Mozilla. XUL is an XML dialect for writing graphical user interfaces, enabling developers to write user interface elements in a manner similar to web pages.
XUL applications rely on the Mozilla codebase (or a fork of it); the most prominent example is the Firefox web browser. However, in recent years, Mozilla has been reducing the usage of XUL in Firefox.[1][2] The most notable example is the removal of add-on customization. Firefox originally permitted add-ons to extensively alter its user interface via custom XUL code, but this capability was removed in 2017 and replaced with the less-permissive WebExtensions API.[3][4] Several forks of Firefox, such as Pale Moon,[5] Basilisk,[6] and Waterfox,[7] retain support for XUL add-ons.
History
XUL was devised at Netscape in 1997 as part of the development effort that eventually became the Mozilla codebase.[8] XUL is similar to web technologies implemented by the Gecko rendering engine. When XUL was introduced, it added features beyond the then standard HTML 4. It was designed as an expansion of HTML to be used with applications rather than documents.[9]
XUL was used by various Mozilla projects, forks of Mozilla projects, and projects closely related to Mozilla. Some software projects like Zotero began as Mozilla Firefox extensions and used XULRunner to become standalone desktop applications. In the early 2000s there was some interest in using XUL by other parties, including Amazon,[10] but those have switched over to HTML5.[1][2] The features of HTML5 that made web applications possible, also made much of XUL redundant.[9]
Mozilla released Firefox 57, also known as Firefox Quantum, in 2017. Firefox Quantum switched Gecko to a new multi-process code base derived from their Servo research project. XUL was designed for the original single-process codebase and would have required considerable effort to re-implement. Due to the difficulty of re-creating XUL for their new engine, Mozilla removed support for legacy add-ons, including the use of custom XUL code.[3][4] Mozilla switched extensions over to Google's HTML5-based WebExtensions format. In 2017, Firefox still included 289 XUL bindings for native browser components. By the end of 2019, Mozilla had removed all XUL files from their mozilla-central codebase.[11][1][2]
When Mozilla removed support from Firefox, there were still several applications using XUL. Mozilla began gradually removing XUL support from their email client, Thunderbird. They released Thunderbird 78 without support for XUL-based extensions in 2020.[12] The SeaMonkey internet suite chose to re-implement XUL for the Firefox Quantum codebase and the suite's development has subsequently slowed. The Pale Moon developers forked Mozilla's entire Firefox 52 ESR codebase to create the Unified XUL Platform (UXP) for their Goanna rendering engine. UXP maintains the traditional XUL capabilities.[13] As a result, Pale Moon and other UXP applications have remained single-process but extensible.[14]
Usage
XUL can only be used with the Mozilla codebase (or a fork of it) because the Gecko engine does the XUL rendering.[15]
Application programmers need to 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.
- Widgets: 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: box, grid, stack, deck, etc.
- Events and scripts: script, command, key, broadcaster, observer, etc.
- Data source: template, rule, etc.
- Others: overlay, iframe, browser, editor, etc.
The default behavior of XUL widgets can be altered with XBL bindings.
Example
This example shows three buttons stacked on top of each other in a vertical box container:[16]
<?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">
<layout>
<button id="yes1" label="Yes"/>
<button id="no1" label="No"/>
<button id="maybe1" label="Maybe"/>
</layout>
</window>
Ghostbusters reference
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".[17] 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.[18]
References
- ^ a b c "Life After XUL". Mozilla. Archived from the original on 29 November 2018. Retrieved 28 November 2018.
- ^ a b c "Problems with XUL". mozilla.github.io. Retrieved 2019-06-07.
- ^ a b Firefox 57 release notes
- ^ a b 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.
- ^ Jorge O. Castro (2004-06-15). "Ars Technica sits down with Scott Collins from Mozilla.org". Ars Technica. Retrieved 2018-11-28.
- ^ a b https://yoric.github.io/post/why-did-mozilla-remove-xul-addons/
- ^ "Remote Application Development with Mozilla, Part 2: A Case Study of the Mozilla Amazon Browser (MAB)". Oreillynet. 2003-02-05.
- ^ https://wiki.mozilla.org/Firefox/XUL_and_XBL_Replacement
- ^ https://developer.thunderbird.net/add-ons/updating/tb78/changes
- ^ "UXP vs goanna".
- ^ "There is only XUL". Retrieved 18 September 2018.
- ^ "Gecko FAQ | MDN". developer.mozilla.org. Archived from the original on 2019-10-08. Retrieved 2021-01-05.
- ^ "The Box Model - Mozilla | MDN". 2017-12-09. Archived from the original on 2017-12-09. Retrieved 2021-01-05.
- ^ Ghostbusters clip
- ^ Mozilla XML Namespace