Mozilla XUL Part 1

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.

Tools Needed

   Mozilla Firefox 3.6
    XULRunner 1.9.2
    Mozilla Firefox 4b
    XULRunner 2
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.


This chrome package registration is the way Firefox extensions are able to add features to the browser. The extensions are small packages of XUL files, JavaScript, style sheets and images packed together into a single file .zip

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:


Types of chrome providers:

  • Content. Content can consist of any file type viewable from within Mozilla. In particular, the content provider most often consists of a set of XUL, JavaScript and XBL binding files.
  • 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.
Content Packages
— 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,

Create jar


CLICK HERE Source Code for mozilla XUL

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s