XUL cross-platform language for describing applications’ user interfaces.
XUL (pronounced "zool" and rhyming with "cool") was created to make development of the Mozilla browser easier and faster.
What can be done using XUL ?
- Input controls such as textboxes and checkboxes
- Toolbars with buttons or other content
- Menus on a menu bar or pop up menus
- Tabbed dialogs
- Trees for hierarchical or tabular information
- Keyboard shortcuts
How can XUL be used ?
- Firefox extension
- Standalone XULRunner application
- XUL package
- Remote XUL application
You should have an understanding of HTML and at least a basic understanding of XML and CSS.
Mozilla Firefox 3.6
Mozilla Firefox 4b
Guidelines to keep in mind.
- XUL elements and attributes should all be entered in lowercase as XML is case-sensitive (unlike HTML).
- Attribute values in XUL must be placed inside quotes, even if they are numbers.
- XUL files are usually split into four files, one each for the
- layout and elements,
- for style declarations,
- for entity declarations (used for localization)
- for scripts.
- In addition, you may have extra files for images or for platform specific data.
The extension will hook into the browser using a XUL specific feature called an overlay which allows the XUL from the extension to mesh with the XUL in the browser.
‘ chrome:// ‘ URL always refers to installed packages and extensions.
Types of document in Mozilla:
HTML, XML, and XUL.
Types of chrome providers:
- Locale. Translations for multi-language support. The two main types of files are DTD files and java-style properties files.
- Skin. The skin provider provides complete appearance data for the user interface. Consisting of CSS files and images.
— other browser XUL and JS files goes here —
— bookmarks files go here —
— preferences files go here —
Skins or Themes
— other browser skin files go here —
— global skin files go here —
Global dialogs and definitions.
basic syntax of the lines in the manifest file for content packages is:
‘content <packagename> <filepath>’
browser.manifest file used by Firefox looks like this:
content branding jar:browser.jar!/content/branding/ xpcnativewrappers=yes
content browser jar:browser.jar!/content/browser/ xpcnativewrappers=yes
overlay chrome://global/content/viewSource.xul chrome://browser/content/viewSourceOverlay.xul
overlay chrome://global/content/viewPartialSource.xul chrome://browser/content/viewSourceOverlay.xul
overlay chrome://browser/content/pageInfo.xul chrome://pippki/content/PageInfoOverlay.xul
Two packages are listed here, ‘branding’ and ‘browser’. Three overlays are also specified,