Home > Enterprise Linux Tips > Administrator > Inspecting Web pages with Mozilla
Enterprise Linux Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ADMINISTRATOR

Inspecting Web pages with Mozilla


Nigel McFarlane
06.02.2004
Rating: -4.22- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Modern Web browsers have extensive support for the standards defined by the World Wide Web Consortium. The Mozilla browsers, both the Application Suite and Firefox, include a tool called the DOM Inspector that exploits these standards. Here we'll take it for a quick spin.

Despite its very-nearly-but-not-quite-entirely-finished status, the DOM Inspector has been a hit with Web developers. Even those Web folk trapped in the embrace of Microsoft's Internet Explorer sometimes use it as a diagnostic tool. It's that good. It can also be downloaded as an add-on to the Netscape 7.x browsers. Its pre-1.0 status means you need to fiddle a bit to get it humming along, but the effort is worth it.

Here's how you get going with DOM Inspector. Starting with any browser window, choose from the menu bar Tools | DOM Inspector, or Tools | Web Development | DOM Inspector, whichever works. A new DOM Inspector window appears -- you can have several such windows if you need them. Depending on the browser, the DOM Inspector might or might not be able to inspect already-displayed browser windows. It can always, however, inspect browser windows started up after the Inspector is ready, so start a new window (from the menu, File | New ..., or just type Control-N). Display some common Web page in that window, like www.yahoo.com.

To inspect that browser window, choose File | Inspect a Window, and then the window with the sample Web page. You can use the DOM Inspector to inspect the DOM Inspector window itself, but that's too confusing for a first run. Once you've picked the window to inspect, the DOM Inspector left-hand pane fills with an outline of that window's content, based on the W3C DOM 1 Core standard. Surprisingly, that content looks nothing like HTML.

Most Mozilla windows hold firstly XUL content, since that's how portable Mozilla products are made. The HTML page (www.yahoo.com) is inside that XUL content, so you have to drill down to find it. You drill down through the branches of the tree by clicking on the expandable twisties (the little plusses or triangles). If you drill down in this order: #document, window, hbox, vbox (the second one), tabbrowser, xul:tabbox, xul:tabpanels, xul:browser and finally #document, you'll be rewarded with a node named HTML. That node is the start of the HTML Document loaded into the studied window.

Of course, all those other mystery XUL tags are also interesting, but it's the HTML that's a familiar reference point for experimentation. From there, you can explore the structure of the sample page as much as you like. Note that there are several things to press and drag in the DOM Inspector sub-windows. They can be used to resize or rearrange the display for you.

One useful feature of the DOM Inspector is the drop-down menu at the top of the right pane. Normally it's labeled "Object -- DOM Node". If you click on the HTML tag on the left, and choose "CSS Computed Style" from this menu, then the DOM Inspector reports the results of the cascading system used for CSS. This can be used to poke about in a Web page to see what's hidden and what's not. It also shows Mozilla's many extensions and precursors to the standards -- those styles all start with -moz. In short, the DOM Inspector grants a glimpse inside browser technology and Web pages that is otherwise hard to see.


Rate this Tip
To rate tips, you must be a member of SearchEnterpriseLinux.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Enterprise Linux Web Server & Application Server
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts