DOM Inspector

From MozillaZine Knowledge Base
Revision as of 16:19, 25 February 2004 by Miahz (talk | contribs) (moving domi content here from Dev : Theme Development)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The DOM Inspector

What is the DOMI?

The DOM Inspector is a Mozilla tool used to inspect, browse, and edit the Document Object Model [1][2] of web documents and XUL[3] interfaces[4]. The article "Introduction to the DOM Inspector," by Ian Oeschger, provides a basic overview of the DOMI. It's a good place to orient yourself with the DOMI and learn how to use its features. The article has some Mozilla Suite-specific references, but most of the information can still be applied to using the DOMI in Firefox and other programs.
Mozilla.org's DOM Inspector FAQ has some additional info.
The Creating Applications with Mozilla book hosted at mozdev.org also has a section about the DOMI.

Getting the DOMI

The DOMI is included in recent Firefox builds [5], but is an option in the Windows installer. It is not currently available in Thunderbird, but a Mozillazine forums thread has some info about building Thunderbird with the DOMI.

The Inspector Widget extension adds an Inspect toolbar button and the menu option Tools > Web Development > DOM Inspector. Selecting an element after clicking the Inspect button will launch the DOMI and inspect the element.

Using the DOMI

The Using the DOM Inspector section in "Introduction to the DOM Inspector" explains what you can do once you get the DOMI. As a theme developer, the DOMI will allow you to view the various properties associated with any XUL element.

  • Browse the tree structure of interface elements
  • View an element's Box Model properties like border and padding
  • Find element names, IDs, and classes to target elements in CSS
  • Find out what files (CSS, images) are used to style an element

Issues with the DOMI

Warning! Changing themes while using the DOMI can cause the program to crash.