Specifying Startup Chrome Window

Main Chrome Window

In order to specify the main chrome window of your XULRunner application, you'll need to add a preferences file to your application directory structure and add a preference named toolkit.defaultChromeURI to that file.

Let's look at the xulmine XULRunner application. It's directory structure is as follows:

xulmine
├───chrome
├───components
└───defaults
    └───preferences

In defaults/preferences, there is a file named xulmine.js. Its contents are:

pref("toolkit.defaultChromeURI", "chrome://xulmine/content/xulmine.xul");

The toolkit.defaultChromeURI preference specifies that the XUL window at chrome://xulmine/content/xulmine.xul is the main application window.

Specifying a Single Instance Main Window

By default, each time the user launches the application XULRunner opens the window specified by toolkit.defaultChromeURI. An application wishing to have only one main window should set the toolkit.singletonWindowType preference and specify the windowtype attribute on the main application window.

Specifying Window Features

By default, the main window is opened as a resizeable, non-dialog chrome window. This default can be changed by setting the toolkit.defaultChromeFeatures preference.

Document Tags and Contributors

Tags: 
 Contributors to this page: teoli, fscholz, Sheppy, Kastor, bsmedberg, NickolayBot, Nickolay, Electrolysis, iosart
 Last updated by: teoli,