Firebug 1.5: Editing, Debugging, and Monitoring Web Pages
By Chandan Luthra and Mittal Deepak
3/5
()
About this ebook
With the advent of RIA (Rich Internet Applications), most web pages are driven by a combination of JavaScript, AJAX, CSS, and so on. Web developers and designers find it hard to debug and fix the issues that crop up on the client side. Firebug is a wonderful toolkit to have in your arsenal for handling all such issues. This book covers all of Firebug's features and will help you utilize its capabilities with maximum efficiency. AJAX development and debugging is not one of the easiest tasks; this book explains step-by-step, how to develop and debug AJAX components in your web page in a very easy way, thereby increasing your productivity. Topics like performance tuning of the web page are covered in detail.
This book discusses how to become more efficient in various aspects of web development by using Firebug. It is a very easy-to-understand, step-by-step guide that explains all the features of Firebug with concise and simple examples. With this book in hand, you will be able to deal with the painful areas of web development like JavaScript and AJAX debugging using Firebug.
The book takes you from the basics of Web Development like editing HTML and CSS on the fly to advanced features like AJAX, JSON, Monitoring, and Performance Tuning of web pages. It assumes that you have some very basic knowledge of HTML and JavaScript. For those of you with a sound knowledge of these technologies, this book can help you increase your productivity by using Firebug effectively, taking full advantage of its rich and powerful features and the console API. Towards the end, the book explains how to create your own powerful extensions for the Firebug community.
This practical guide will equip you with the skills to edit, debug, and monitor web pages using Firebug
ApproachA step-by-step description of each key feature is provided with the help of simple, easy-to-understand examples. There are plenty of useful screenshots in each chapter. Every chapter contains information as well as tips and tricks to draw your attention towards some useful information or reference. Each aspect of web development like CSS or JavaScript is handled independently so that you can refer to those modules in which you are interested.
Who this book is forThis book is written for frontend web developers building software and pages using HTML, CSS, JavaScript, and AJAX, who want to learn Firebug for the reasons outlined above. The book assumes that readers have a very basic knowledge of HTML, JavaScript, and CSS. The examples in the book can be understood by someone who has just been introduced to web development.
Related to Firebug 1.5
Related ebooks
PHP and script.aculo.us Web 2.0 Application Interfaces: Build powerful interactive AJAX applications with script.aculo.us and PHP Rating: 0 out of 5 stars0 ratingsB4A: Rapid Android App Development using BASIC Rating: 0 out of 5 stars0 ratingsjQuery UI 1.6: The User Interface Library for jQuery Rating: 0 out of 5 stars0 ratingsYUI 2.8: Learning the Library Rating: 4 out of 5 stars4/5Learning PrimeFaces Extensions Development Rating: 0 out of 5 stars0 ratingsMastering Yii Rating: 0 out of 5 stars0 ratingsLearning Dojo Rating: 0 out of 5 stars0 ratingsLearning Drupal 6 Module Development Rating: 3 out of 5 stars3/5Using Yocto Project with BeagleBone Black Rating: 0 out of 5 stars0 ratingsMastering Go: Leverage Go's expertise for advanced utilities, empowering you to develop professional software Rating: 0 out of 5 stars0 ratingsBabylon.js Essentials Rating: 0 out of 5 stars0 ratingsKotlin Programming By Example: Build real-world Android and web applications the Kotlin way Rating: 0 out of 5 stars0 ratingsLearning AWS Lumberyard Game Development Rating: 0 out of 5 stars0 ratingsMODx Web Development Rating: 0 out of 5 stars0 ratingsBlender 2.49 Scripting Rating: 0 out of 5 stars0 ratingsSencha Touch 2 Mobile JavaScript Framework Rating: 0 out of 5 stars0 ratingsMastering Dart Rating: 0 out of 5 stars0 ratingsTapestry 5: Building Web Applications Rating: 3 out of 5 stars3/5Python for Developers: Learn to Develop Efficient Programs using Python Rating: 0 out of 5 stars0 ratingsCryEngine Basics: First Steps in Game Development: CryEngine Series Rating: 0 out of 5 stars0 ratingsAndroid Programming for Beginners Rating: 3 out of 5 stars3/5TYPO3 Extension Development Rating: 0 out of 5 stars0 ratingsEJB 3.0 Database Persistence with Oracle Fusion Middleware 11g Rating: 0 out of 5 stars0 ratingsLearn C# Programming by Creating Games with Unity Rating: 0 out of 5 stars0 ratingsHands-On TypeScript for C# and .NET Core Developers: Transition from C# to TypeScript 3.1 and build applications with ASP.NET Core 2 Rating: 0 out of 5 stars0 ratingsTools and Skills for .NET 8: Get the career you want with good practices and patterns to design, debug, and test your solutions Rating: 0 out of 5 stars0 ratings
Software Development & Engineering For You
Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5Python For Dummies Rating: 4 out of 5 stars4/5Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Fundamentals of Software Engineering: Designed to provide an insight into the software engineering concepts Rating: 0 out of 5 stars0 ratingsGrokking Simplicity: Taming complex software with functional thinking Rating: 4 out of 5 stars4/5Good Code, Bad Code: Think like a software engineer Rating: 5 out of 5 stars5/5RESTful API Design - Best Practices in API Design with REST: API-University Series, #3 Rating: 5 out of 5 stars5/5Coding with AI For Dummies Rating: 1 out of 5 stars1/5Beginning Programming For Dummies Rating: 4 out of 5 stars4/5How to Write Effective Emails at Work Rating: 4 out of 5 stars4/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5Git Essentials Rating: 4 out of 5 stars4/5Agile Project Management: Scrum for Beginners Rating: 4 out of 5 stars4/5UX Simplified: Models & Methodologies Rating: 3 out of 5 stars3/5Flow: A Handbook for Change-Makers, Mavericks, Innovators and Leaders Rating: 0 out of 5 stars0 ratingsWordpress 2023 A Beginners Guide : Design Your Own Website With WordPress 2023 Rating: 0 out of 5 stars0 ratingsAgile Practice Guide Rating: 4 out of 5 stars4/5Beginning C++ Programming Rating: 3 out of 5 stars3/5Ry's Git Tutorial Rating: 0 out of 5 stars0 ratingsTiny Python Projects: Learn coding and testing with puzzles and games Rating: 4 out of 5 stars4/5Oracle PL / SQL For Dummies Rating: 0 out of 5 stars0 ratingsKanban: A Quick and Easy Guide to Kickstart Your Project Rating: 4 out of 5 stars4/5Lean Management for Beginners: Fundamentals of Lean Management for Small and Medium-Sized Enterprises - With many Practical Examples Rating: 0 out of 5 stars0 ratingsDevOps For Dummies Rating: 4 out of 5 stars4/5Level Up! The Guide to Great Video Game Design Rating: 4 out of 5 stars4/5Scrum: Understanding Scrum at a Deeper Level and Mastering Agile Project Management Rating: 4 out of 5 stars4/5
Reviews for Firebug 1.5
1 rating0 reviews
Book preview
Firebug 1.5 - Chandan Luthra
Table of Contents
Firebug 1.5: Editing, Debugging, and Monitoring Web Pages
Credits
About the Authors
About the Reviewers
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code for the book
Errata
Piracy
Questions
1. Getting Started with Firebug
What is Firebug?
The history of Firebug
The need for Firebug
Firebug capabilities
Installing Firebug on different browsers
Installing Firebug on Firefox
Installing Firebug on non-Firefox browsers
Opening and closing Firebug
Firebug modes
Dock view
Window mode
Summary
2. Firebug Window Overview
Console tab
Command line JavaScript
Errors and warnings
Status bar error indicator
Errors can be descriptive and informative
Executing JavaScript commands
HTML tab
The hierarchy of DOM nodes (the HTML source panel)
Options for HTML source panel
Editing HTML on the fly
Editing an existing attribute of HTML element
Editing an HTML element
Logging events
CSS tab
CSS inspector
List of CSS files
Modifying CSS
Script tab
DOM tab
Net tab
Summary
3. Inspecting and Editing HTML
Viewing source live
Seeing changes highlighted
Modifying the source on the fly
How to modify the value of an HTML attribute
How to add a new attribute to an existing HTML element
How to delete an HTML element
How to modify the source for an HTML element
Inspecting page components, editing, and reloading
Searching within an HTML document
Finding an HTML element on the page
Copying HTML source for an HTML element
Setting breakpoints on HTML element
Summary
4. CSS Development
Inspecting cascading rules
Preview colors and images
Tweaking CSS on the fly
Enabling and disabling specific CSS rules
Inspecting our stylesheet
Modifying CSS from Firebug's UI
Inspecting and tweaking the box model
Searching under the CSS tab
Summary
5. JavaScript Development
The command line API
$(id)
$ $$(selector)
$x(xpath)
dir(object)
dirxml(node)
clear()
inspect(object[, tabName])
keys(object)
values(object)
debug(fn) and undebug(fn)
monitor(functionName) and unmonitor(functionName)
monitorEvents(object[, types])
unmonitorEvents(object[, types])
profile([title]) and profileEnd()
Columns and description of the profiler
The console API
console.log(object[, object, ...])
console.debug(object[, object, ...])
console.info(object[, object, ...])
console.warn(object[, object, ...])
console.error(object[, object, ...])
console.assert(expression[, object, ...])
console.dir(object)
console.dirxml(node)
console.trace()
console.group(object[, object, ...])
console.groupCollapsed(object[, object, ...])
console.groupEnd()
console.time(name)
console.timeEnd(name)
console.profile([title])
console.profileEnd()
console.count([title])
JavaScript debugging
Steps to debug JavaScript code with Firebug
Conditional breakpoints
Summary
6. Knowing Your DOM
Inspecting DOM
Filtering properties, functions, and constants
Modifying DOM on the fly
Auto-complete
Losing the starting element
Adding/removing the DOM elements' attributes
Removing attributes
Adding attributes
JavaScript code navigation
Summary
7. Performance Tuning Our Web Application
Network monitoring
Description of information in the Net panel
Load-time bar color significance
Browser queue wait time
Breaking down various requests by type
Examining HTTP headers
Analyzing the browser cache
XMLHttpRequest monitoring
How to find out the download speed for a resource
Firebug extensions for analyzing performance
Summary
8. AJAX Development
Tracking XmlHttpRequest
Request/response headers and parameters
GET/POST request
Viewing live modifications on DOM
Debugging AJAX calls using properties of a console object
console.debug(object[, object, ...])
console.assert(expression[, object, ...])
console.dir(object)
Summary
9. Tips and Tricks for Firebug
Magical cd()
The hierarchical console
Configuring Firebug to our taste
Summary
10. Necessary Firebug Extensions
YSlow
Firecookie
Pixel Perfect
Pixel Perfect options menu
Firefinder
FireQuery
CodeBurner
SenSEO
Page Speed
Summary
11. Extending Firebug
Setting up an extension development environment
Setting up the development profile
Development preferences
Getting started with a small Hello World!
extension of Firebug
The chrome.manifest file
The install.rdf file
The helloWorldOverlay.xul file
The helloWorld.js file
Packaging and installation
Taking Hello World!
to the next level
The prefs.js
file
The helloWorld.js
file revisited
Summary
A. A Quick Overview of Firebug's Features and Options
Keyboard and mouse shortcuts reference
Global shortcuts
HTML tab shortcuts
HTML editor shortcuts
HTML inspect mode shortcuts
Script tab shortcuts
DOM tab shortcuts
DOM and watch editor shortcuts
CSS tab shortcuts
CSS editor tab shortcuts
Layout tab shortcuts
Layout editor shortcuts
Command line (small) shortcuts
Command line (large) shortcuts
Console API reference
Command line API reference
Firebug online resources
Features expected in future releases of Firebug
Firebug 1.6
Some improvements in this version
Scrolling panel tab bar
FBTest support for Firebug extensions
Locales as extensions
Extension points for panel buttons and main menu options
Breakpoint column for the HTML panel
Break on next CSS change and CSS breakpoints
Options for the break on next feature (mainly a UI-related issue)
Net panel improvements
Script panel improvements
JavaScript function support
Firebug 1.7
Separate modules and panels
Issue: File names versus folder names
Components replaced by SharedObjects
Issue: SharedObject API
Recode TabWatcher/DOMWindowWatcher
Sandboxed extension loading
Memory panel
Index
Firebug 1.5: Editing, Debugging, and Monitoring Web Pages
Deepak Mittal
Chandan Luthra
Firebug 1.5: Editing, Debugging, and Monitoring Web Pages
Copyright © 2010 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: April 2010
Production Reference: 1300310
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-847194-96-1
www.packtpub.com
Cover Image by Filippo Sarti (<[email protected]>)
Credits
Authors
Chandan Luthra
Deepak Mittal
Reviewers
Balaji D Loganathan
Michael Ratcliffe
Michael Sync
Acquisition Editor
Dilip Venkatesh
Development Editor
Dilip Venkatesh
Technical Editors
Gaurav Datar
Rukhsana Khambatta
Copy Editor
Sanchari Mukherjee
Indexer
Hemangini Bari
Editorial Team Leader
Gagandeep Singh
Project Team Leader
Lata Basantani
Project Coordinator
Poorvi Nair
Proofreader
Aaron Nash
Graphics
Geetanjali G. Sawant
Production Coordinator
Adline Swetha Jesuthas
Cover Work
Adline Swetha Jesuthas
About the Authors
Chandan Luthra is a Software Development Engineer with IntelliGrape Software, New Delhi, India—a company specializing in Groovy/Grails development. He is an agile and pragmatic programmer and an active participant at local open source software events, where he evangelizes Groovy, Grails, Jquery, and Firebug. Chandan is a Linux and open source enthusiast. He also involves himself in writing blogs and is an active member on various tech-related mailing lists. He has developed web applications for various industries, including entertainment, finance, media and publishing, as well as others.
He loves to share his knowledge and good coding practices with other team members in order to hone their development skills. In his free time, he loves to contribute to open source technologies.
Chandan also loves to code in jQuery and Firebug, which makes development very easy for him. He is a very fond user of Firebug and has been using it since 2007.
I would like to thank my family for their love and support during my far-flung adventures into esoteric nonsense. Thanks also to all my cooperative colleagues at IntelliGrape for their feedback and suggestions. I would also like to thank Deepak Mittal for co-authoring and motivating me to write this book. Finally, I wish to thank Dilip Venkatesh (Acquisition Editor at Packt), Poorvi Nair (Project Coordinator at Packt), Micheal Sync (Reviewer), Micheal Ratcliffe (Reviewer), and Balaji Loganathan (Reviewer) for giving a perfect shape to this book. Special thanks to S. Vivek Krishna for his help on the Preface of the book.
Deepak Mittal is a software developer based in New Delhi, India, and he has been involved with software engineering and web programming in Java/JEE world since the late 1990s. Deepak is a Linux and open source enthusiast. He is an agile practitioner and speaks about open source, agile processes, and free software at various user group meetings and conferences. He has designed and built web applications for industries including pharmaceutical, travel, media, and publishing, as well as others. He loves to explore new technologies and has been an early-adopter of quite a few mainstream technologies of today's world.
In early 2008, he co-founded IntelliGrape Software, an agile web application development company focused on Groovy and Grails. At IntelliGrape, he has been occupied with building world class applications on Grails and also mentors and trains other team members.
Deepak is a veteran user of Firebug and has been using it since 2006.
I want to thank all my colleagues at IntelliGrape for their valuable feedback and suggestions, my family for putting up without me for weeks, and all the contributors of Firebug. My special thanks go to Dilip Venkatesh (Acquisition Editor at Packt), Poorvi Nair (Project Coordinator at Packt), Chandan Luthra (my co-author), and all the reviewers of the book.
About the Reviewers
Balaji D Loganathan has 10+ years of experience in the software field, is a CEO and Co-founder of Spritle Software—a software development company in Chennai, India. Balaji is an Agile Guru specializing in Agile Offshore, a Certified Scrum Master. Balaji has a Master's degree in IT from the RMIT, Australia and a Bachelors Degree in Engineering from the Annamalai University, India.
When Michael Ratcliffe was 9 years old he saw a movie called Wargames
. Like many kids his age he became very interested in computers. A few weeks later he was playing Roland in the Caves
on a friend's Amstrad CPC 464 when the game crashed and the command prompt displayed Illegal Operation.
Believing that he had hacked something, he decided that he wanted to become a full time hacker and therefore became much more determined to learn how computers work and what can be done with them.
At 12 years of age, his parents bought him an Acorn Electron Microcomputer as a Christmas present. Within 6 months he had written his first game, Wargames, in BBC Basic. By the time he was 14, he was regularly writing programs in 6502 Assembly language and would regularly send pokes (infinite lives, invulnerability, and so on) to computer magazines to help people with their new games.
At 15 years of age, he started work in IT as a support engineer. His use of programming languages extended to Turbo C, C++, Pascal, Delphi, C#, VB, VBScript, VB.NET, HTML, JavaScript, ASP, PHP, Perl, and so on. Some years later he discovered that he was spending a large amount of time writing tools to help his colleagues with their work and decided that he should get the paper qualifications he would need. He started as a computer science major but, after receiving a ton of job offers in the field, he just dropped out of university and has been professional ever since.
Michael is currently working for Comartis AG, Switzerland on e-Learning software called i-qbox Human Performance Suite. He works daily with VB.NET, C#, and JavaScript but prefers JavaScript, claiming that its quirks just make the language more fun. As the JavaScript Guy
he uses Firebug to get his work done