firebug 1.5 editing debugging and monitoring web pages

211 704 0
firebug 1.5 editing debugging and monitoring web pages

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

www.it-ebooks.info Firebug 1.5: Editing, Debugging, and Monitoring Web Pages Arm yourself to destroy UI and JavaScript bugs Chandan Luthra Deepak Mittal BIRMINGHAM - MUMBAI www.it-ebooks.info 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 (filosarti@tiscali.it) www.it-ebooks.info Credits Authors Editorial Team Leader Chandan Luthra Gagandeep Singh Deepak Mittal Project Team Leader Lata Basantani Reviewers Balaji D Loganathan Project Coordinator Michael Ratcliffe Poorvi Nair Michael Sync Proofreader Acquisition Editor Aaron Nash Dilip Venkatesh Development Editor Graphics Dilip Venkatesh Geetanjali G Sawant Technical Editors Production Coordinator Gaurav Datar Adline Swetha Jesuthas Rukhsana Khambatta Copy Editor Cover Work Adline Swetha Jesuthas Sanchari Mukherjee Indexer Hemangini Bari www.it-ebooks.info 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 www.it-ebooks.info 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 www.it-ebooks.info 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 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 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 www.it-ebooks.info 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 properly In 2008 he began logging Firebug issues and soon began spending lots of time fixing bugs to make his work easier He worked for a time on Firebug Lite but spends most of his "spare time" now working on improving the Firebug Inspector, which he likes to think of as "Aardvark on Steroids." He would like to thank his wife Sabine for her patience during the many hours spent performing technical reviews on this book Michael Sync has lately been associated with Memolife as a Solution Architect, responsible for building their products using Silverlight and other Net technologies Prior to venturing into this, he was creating a niche in Web Application Development using ASP.NET, AJAX, JavaScript, and so on He had always believed in the concept of "Sharing Knowledge", which is the key to building his in-depth understanding of the technology That's the main reason why he always tries to participate in public forums and local newsgroups for helping fellow technologists; benefits are also received, as learning is a two-way process Being a member of Microsoft WPF/Silverlight Insider team, he really enjoys playing with early drops of Silverlight and giving his feedback to the team www.it-ebooks.info Table of Contents Preface Chapter 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 7 8 9 10 10 11 11 12 12 13 Chapter 2: Firebug Window Overview 15 Status bar error indicator Errors can be descriptive and informative Executing JavaScript commands 18 19 19 Console tab Command line JavaScript Errors and warnings HTML tab The hierarchy of DOM nodes (the HTML source panel) Options for HTML source panel 15 16 17 20 21 22 Editing HTML on the fly 23 Logging events 26 Editing an existing attribute of HTML element Editing an HTML element www.it-ebooks.info 23 24 Table of Contents CSS tab CSS inspector List of CSS files Modifying CSS Script tab DOM tab Net tab Summary 29 29 30 30 34 36 38 40 Chapter 3: Inspecting and Editing HTML 41 Chapter 4: CSS Development 55 Chapter 5: JavaScript Development 67 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 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 The command line API $(id) $ $$(selector) $x(xpath) dir(object) dirxml(node) clear() [ ii ] www.it-ebooks.info 41 43 44 45 46 47 47 48 50 51 52 52 54 55 57 58 60 62 62 65 65 66 67 67 68 69 70 71 72 Appendix Task / operation console.groupEnd() Purpose console.time(name) Creates a new timer under the given name Call console.timeEnd(name) with the same name to stop the timer and print the time elapsed console.timeEnd(name) Stops a timer created by a call to console time(name) and writes the time elapsed console.profile([title]) Turns on the JavaScript profiler The optional argument title would contain the text to be printed in the header of the profile report console.profileEnd() Turns off the JavaScript profiler and prints its report console.count([title]) Returns the count of how many times the line of code is executed The optional argument title will print a message in addition to the number of the count Closes the most recently opened block created by a call to console.group() or console groupEnd() Command line API reference The Firebug command line allows user-entered expressions to be evaluated in the page, similar to having scripts in our page It is one of the most useful and powerful features of Firebug Here is the quick cheat sheet for command line: Command $(id) Purpose $$(selector) Returns an array of elements that match the given CSS selector $x(xpath) Returns an array of elements that match the given XPath expression dir(object) Prints an interactive listing of all properties of the object This looks identical to the view that we would see in the DOM tab dirxml(node) Prints the XML source tree of an HTML or XML element This looks identical to the view that we would see in the HTML tab We can click on any node to inspect it in the HTML tab Returns a single element with the given ID [ 191 ] www.it-ebooks.info A Quick Overview of Firebug's Features and Options Command cd(window) Purpose clear() Clears the console inspect(object[, tabName]) Inspects an object in the most suitable tab, or the tab identified by the optional argument tabName By default, command line expressions are relative to the top-level window of the page cd() allows us to use the window of a frame in the page instead The available tab names are HTML, CSS, SCRIPT, and DOM keys(object) Returns an array containing the names of all properties of the object values(object) Returns an array containing the values of all properties of the object debug(fn) Adds a breakpoint on the first line of a function undebug(fn) Removes the breakpoint on the first line of a function monitor(fn) Turns on logging for all calls to a function unmonitor(fn) Turns off logging for all calls to a function monitorEvents(object[, types]) Turns on logging for all events dispatched to an object The optional argument types may specify a specific family of events to log The most commonly used values for types are mouse and key The full list of available types includes composition, contextmenu, drag, focus, form, key, load, mouse, mutation, paint, scroll, text, ui, and xul unmonitorEvents(object[, types]) Turns off logging for all events dispatched to an object profile([title]) Turns on the JavaScript profiler The optional argument title would contain the text to be printed in the header of the profile report profileEnd() Turns off the JavaScript profiler and prints its report [ 192 ] www.it-ebooks.info Appendix Firebug online resources The following are a few online references for some useful information, such as releases, issues, new features, extensions, and so on: Resource description Firebug site homepage Firebug wiki homepage URL http://getfirebug.com/ Firebug Google group http://getfirebug.com/wiki/index.php/ Main_Page http://video.yahoo.com/ watch/111581/938140 http://groups.google.com/group/firebug Firebug issues tracking system on Google code http://code.google.com/p/fbug/issues/ list Firebug internals page on Mozilla site https://developer.mozilla.org/en/ FirebugInternals Firebug plugins page on Firebug site http://getfirebug.com/extensions/ Firebug video by Joe Hewitt Features expected in future releases of Firebug Firebug is a rapidly growing application and every new version of it has major changes as compared to the previous versions The Firebug Working Group has some initial plans for Firebug 1.6 and 1.7, the short versions Firebug 1.6 In this version, Firebug will focus on Firebug extension technologies and deliver most of its new functions as extensions The major new work will be the Swarm implementation A Firebug Swarm is a collection of Firebug extensions that are tested, maintained, and marketed together It is a scheme for distributed development and installation, combined with centralized testing and marketing [ 193 ] www.it-ebooks.info A Quick Overview of Firebug's Features and Options The Firebug development team is aiming for a release in April 2010 Some of the features can be implemented as separate extensions that could be part of the Firebug bundle Some improvements in this version The Firebug team plans what will be included in new releases on the basis of discussions on the mailing list, the forums, and the community, as well as issues and bugs Here are some enhancements and improvements that Firebug will have in its next release Scrolling panel tab bar Some scrolling support is necessary as extensions often create a new panel and there is not enough space for displaying all of them FBTest support for Firebug extensions The Swarm will support testing of Firebug extensions together with Firebug, but using Firebug's tests Firebug also needs a solution for extensions to add their own tests Locales as extensions Having this has two advantages: • Users can switch back to the default en-US language • If some strings are not translated, we can use them from the default language Currently the string key (formatted for this purpose) itself is used as the default Extension points for panel buttons and main menu options Some smaller extensions are actually harder to write than new panels because Firebug has no support for adding menu options and buttons Therefore, some extension points will be there in Firebug for panel buttons and main menu options so that one can quickly develop a new extension Breakpoint column for the HTML panel Similar to the Script, DOM, and Net panel, the HTML panel should also offer a vertical column (on the left-hand side of the panel content) in order to easily create a breakpoint HTML mutation breakpoint creation is currently hidden behind a context menu [ 194 ] www.it-ebooks.info Appendix Break on next CSS change and CSS breakpoints Like HTML, Script, and Net panel, we can create breakpoints on the CSS panel This feature will allow user to set breakpoints, which will be triggered whenever CSS change is encountered Options for the break on next feature (mainly a UI-related issue) The break on next feature should have options for every panel: • XHR: Break on request/response • Script: Break on click, mousemove, and so on Net panel improvements The following are mostly issues for improving the Net panel reported in the Firebug issue list: • New columns with additional information—for example, IP address (hidden by default) • Change the order of columns • Showing cache reads (not network communication really) Script panel improvements The following is a list of proposed improvements of the script panel that need to be done in this version of Firebug: • Improve the script location menu Group scripts (by inline, events, evaluated) and use nested menus • Jump from function calls to their definition • Jump from the ID defined in getElementById() to element in HTML panel • Jump from a variable name to the DOM panel by holding down Ctrl and clicking on it • Every variable could have a context menu entry for putting it to the watch list [ 195 ] www.it-ebooks.info A Quick Overview of Firebug's Features and Options JavaScript function support Firebug is aiming to rework on JavaScript's "function" support with new JavaScript debugging features that will show us: • A list all of the objects that refer to a function • The property names Firebug 1.7 This version of Firebug is targeted to be released in September 2010 In this version, Firebug focuses on refactoring the architecture of Firebug With this change in the architecture, the following features will be added: • Prepare to support remote debugging for mobile and multiprocessing browsers: °° °° • Server side will be headless Client side will have no access to Firefox data Allow simpler and more robust extensions: °° °° • JavaScript oriented loading, no XPCOM (Cross Platform Component Object Model) loader required Isolation and concentration of extension code Clean up expedient code and clarify the implementation: °° Relation to platform window system °° Relation of panels and modules °° Prepare/exploit shift to jetpack Following are some proposed changes for Firebug 1.7: Separate modules and panels Broadly speaking, Mike Collins' architecture for remote Firebug puts the module code in the server and the panel code in the client (UI side) The Firebug's context object (TabContext.js) is passed over the wire between them using CrossFire The first step in that direction is to divide all of the source into module and panel files For example, we might have debuggerModule.js and debuggerPanel.js Then firebug.js would be divided between module dispatch and panel dispatch (dispatchModules.js and dispatchPanels.js) The API between these objects would be the remote CrossFire API [ 196 ] www.it-ebooks.info Appendix Issue: File names versus folder names However, it's more common to need to write with one kind of module and panel rather than all the panels and modules Creating a subdirectory for each feature, for example, debugger.js/module.js, makes a lot of small folders Any scheme where the folder is used to disambiguate makes a lot of tools hard to use because we end up with a lot of UI selections, such as module.js or debugger.js; we can't tell what it means That is how the Firebug team ended up with debuggerModule.js and debuggerPanel.js— where a developer will follow some unambiguous naming convention The name starts with the feature name to make it unique, and hence there is no conflict Components replaced by SharedObjects Firebug currently has five XPCOM components The Firebug team needs to create two more XPCOM modules—ECMA harmony modules and CommonJS modules As these are all in JavaScript, the XPCOM infrastructure only exists to arrange common access between Firebug windows By creating a single SharedObject XPCOM component, the amount of boiler plate code can be reduced This will also prepare for in-place JavaScript editing and dynamic update features in future Issue: SharedObject API Leverage work by CommonJS: • ECMA harmony modules • CommonJS modules This will put Firebug on the same path as jetpack proposals As far as we know the CommonJS as well as Mozilla platform, Components.utils.module supports common code loading, but common object sharing is also needed So, there may be some additional work on API Recode TabWatcher/DOMWindowWatcher TabWatcher is still very heuristic and relies on Firefox idiosyncrasies that can change Chromebug has its own watcher and even more guesses about the platform Maybe nsIXULWindow and nsIDOMWindow lifetime event notifications will be replaced with a clean abstraction Then we would put it in a SharedObject, so that only one per application is needed, and get a clean API This will require platform support [ 197 ] www.it-ebooks.info A Quick Overview of Firebug's Features and Options Sandboxed extension loading By reapplying the module loading technology, a jetpack-like environmental wrapper for Firebug extensions can be created The extensions will be slightly simpler because they'll just be ZIP files The extensions would be slightly more robust too, as they would be evaluated with eval() in a scope that only contains Firebug This enhancement depends upon the Firefox improvements When Firefox improves, only then can the Firebug team work on this enhancement Memory panel Firebug will provide a new panel for its users This is one of top features that has been requested many times, and it would certainly be very helpful for web application developers It will show some memory profiling activity Apart from the preceding improvements some refactoring and bug fixing will also feature in Firebug 1.7 [ 198 ] www.it-ebooks.info Index Symbols $$(selector) 191 $$(selector) method 68, 69 $(id) 191 $(id) method 67, 68 $x(xpath) 191 $x(xpath) method 69 3.7.*.* 175 0.1 175 2 175 A AJAX 119 AJAX calls debugging, console object used 130 Asynchronous JavaScript and XML See  AJAX awesome@coder.com 175 B bindFixed function 183 box model inspecting 65 tweaking 65 browser cache analyzing 113-115 C callback parameter 122 cd() function 141 cd() method 140 cd(window) 192 cd(window) method 72 Chromebug 172, 197 Chrome Edit Plus 172 Chrome List 172 chrome.manifest file 173 clear() 192 clear() method 72 CodeBurner about 159 steps, for using 159 command line API methods $$(selector) 68 $(id) 67 $x(xpath) 69 cd(window) 72 clear() 72 debug(fn) 74 dir(object) 70 dirxml(node) 71 inspect(object[, tabName]) 72 keys(object) 73 monitorEvents(object[, types]) 76 monitor(functionName) 74, 75 profileEnd() 77 profile([title]) 77 undebug(fn) 74 unmonitorEvents(object[, types]) 76 unmonitor(functionName) 74, 75 values(object) 74 command line API reference 191 command line JavaScript 16 command line (large) shortcuts 189 command line (small) shortcuts 189 CommonJS modules 197 www.it-ebooks.info conditional breakpoints about 86 removing 88 configuration options, Pixel Perfect hide overlay when inspecting 155 hide statusbar info 155 Console2 172 console API methods console.assert(expression[, object, ]) 81 console.count([title]) 82 console.debug(object[, object, ]) 80 console.dir(object) 81 console.dirxml(node) 81 console.error(object[, object, ]) 80 console.groupCollapsed(object[, object, ]) 81 console.groupEnd() 81 console.group(object[, object, ]) 81 console.info(object[, object, ]) 80 console.log(object[, object, ]) 79 console.profileEnd() 82 console.profile([title]) 82 console.timeEnd(name) 82 console.time(name) 82 console.trace() 81 console.warn(object[, object, ]) 80 Console API reference about 190 console functions 190 console.assert(expression[, object, ]) 190 console.assert(expression[, object, ]) method 81 console.assert() function 133 console.count([title]) 191 console.count([title]) method 82 console.debug() 131 console.debug() function 130, 132 console.debug(object[, object, ]) 190 console.debug(object[, object, ]) method 80 console.dir() function 134 console.dir(object) 190 console.dir(object) method 81 console.dirxml(node) 190 console.dirxml(node) method 81 console.error(object[, object, ]) 190 console.error(object[, object, ]) method 80 console functions 190 console.groupCollapsed(object[, object, ]) 190 console.groupCollapsed(object[, object, ]) method 81 console.groupEnd() 191 console.groupEnd() method 81 console.group() function 141 console.group(object[, object, ]) 190 console.group(object[, object, ]) method 81 console.info(object[, object, ]) 190 console.info(object[, object, ]) method 80 console.log(object[, object, ]) 190 console.log(object[, object, ]) method 79 console.profileEnd() 191 console.profileEnd() method 82 console.profile([title]) 191 console.profile([title]) method 82 console tab about 16 command line JavaScript 16 errors and warnings section 17 console.timeEnd(name) 191 console.timeEnd(name) method 82 console.time(name) 191 console.time(name) method 82 console.trace() 190 console.trace() method 81 console.warn(object[, object, ]) 190 console.warn(object[, object, ]) method 80 Crash Me Now! 172 CrossFire API 196 CSS tweaking 58, 60 CSS development about 55 cascading rules, inspecting 55 colors, previewing 57, 58 images, previewing 57 CSS editor tab shortcuts 188 CSS element inspecting 55, 56 CSS files modifying 30-33 viewing 30 CSS inspector 29 [ 200 ] www.it-ebooks.info Domain Specific Languages See  DSLs DOM and watch editor shortcuts 187 DOM attributes adding 100-102 removing 98, 99 DOM editor 96 DOM inspector 91 DOM Inspector 172 DOM tab about 36 functions 36 working 37 DOM tab shortcuts 187 download speed, web resource finding 117 CSS properties enabling/disabling 60-62 CSS rule editing 59 CSS stylesheet box model, inspecting 65 box model, tweaking 65 delete option 64 disable option 64 edit option 64 inspecting 62 new property option 63 new rule option 63 CSS tab about 29 CSS files list 30 CSS inspector 29 CSS, modifying 30-33 functions 29 searching, within 65 CSS tab shortcuts 188 E D debug(fn) 192 debug(fn) method 74 development preferences, extension development environment about 169, 170 setting 171, 172 value, changing 170 dir(object) 191 dir(object) method 70 dirxml(node) 191 dirxml(node) method 71, 72 dock view, Firebug modes 12 Document Object Model See  DOM DOM about 91 constants, filtering 93, 94 functions, filtering 93, 94 inspecting 91, 92 live modifications, viewing 128, 129 modifying 96, 97 modifying, auto-complete used 97 properties, filtering 93, 94 ECMA harmony modules 197 errors and warnings section, console tab about 17 descriptive errors 19 informative errors 19 JavaScript commands, executing 19 status bar error indicator 18 ExecuteJS 172 extend() function 176 Extension Developer Extension 172 extension development environment development preferences 169, 170 development profile, setting up 168, 169 setting up 167 Extension Wizard 172 F features, Firebug 1.6 193-195 features, Firebug 1.7 196-198 Firebug about closing 11 console.groupEnd() function 141 console.group() function 141 console tab 16 CSS tab 29 DOM tab 36 features 7, [ 201 ] www.it-ebooks.info highlight changes feature 43 history HTML source, viewing 41-43 HTML tab 20 inspect functionality 48 installing, on FireFox 10 installing, on non-Firefox browsers 10 keyboard and mouse shortcuts 185 magical cd() function 137 modes 11 need for Net panel 106 net tab 38 opening 11 script tab 34 search box 50 shortcut keys, configuring 143 source, modifying 44 Firebug 1.6 about 193 features 193, 195 Firebug 1.7 about 196 features 196 Firebug Extensions about 147 Chromebug 172 Chrome Edit Plus 172 Chrome List 172 CodeBurner 159 Console2 172 DOM Inspector 172 ExecuteJS 172 Extension Developers Extension 172 Extension Wizard 172 Firecookie 151 Firefinder 155 FireQuery 157 for, analyzing performance 118 JavaScript 172 JavaScript Command 172 MozRepl 172 Page Speed 162 Pixel Perfect 153 SenSEO 160 Venkman 172 XPCOMViewer 172 YSlow 148 Firebug Google group url 193 Firebug internals page on Mozilla site url 193 Firebug issues tracking system on Google code url 193 Firebug Lite about 10 using, on non-Firefox browsers 10 Firebug modes about 11 dock view 12 window mode 12 Firebug online resources about 193 Google group 193 internals page on Mozilla site 193 issues tracking system on Google code 193 plugins page on Firebug site 193 site homepage 193 video 193 wiki homepage 193 firebugOverlay.xul 173 Firebug.Panel object 176 Firebug plugins page on Firebug site url 193 Firebug site homepage url 193 Firebug Swarm 193 Firebug video url 193 Firebug wiki homepage url 193 Firecookie about 151, 152 features 152 functions 152 Firefinder about 155 features 156 steps, for using 155 Firefox Firebug, installing 10 FireQuery about 157 [ 202 ] www.it-ebooks.info features 157 functionality 157 G getOptionsMenuItems() function 180-182 getPanel() function 177 GET/POST request 125-127 GET request 124 headers tab 124 JSON tab 125 response tab 124 getScript() function 131 global shortcuts 185 groupedOutput() function 142 H Hello World! extension about 173 chrome.manifest file 173, 174 drop-down list, attaching 180 helloWorld.js file 176 helloWorld.js file, revisited 181, 182 helloWorldOverlay.xul file 175 installing 177-179 install.rdf file 174 packaging 177, 178 prefs.js file 181 starting 173 helloWorld.js file 176 helloWorldOverlay.xul 173 helloWorldOverlay.xul file 175 highlight changes feature, Firebug 43 HTML editor shortcuts 186 HTML element attribute, editing 23 breakpoints, setting on 52-54 editing 24, 25 events, logging 26, 28 finding, on web page 51, 52 HTML inspect mode shortcuts 186 HTML source copying, for HTML element 52 HTML source, Firebug viewing 41 HTML source, modifying about 44 attribute, adding to HTML element 46 HTML attribute, modifying 45 HTML element, deleting 47 HTML element source, modifying 47 HTML source panel about 21 options 22, 23 HTML tab about 20 events, logging 26, 28 functions 20 HTML element, editing 23 HTML source panel 21 HTML tab shortcuts 186 HTTP headers examining 112 I iFrames 137 iFrame code 138 inspect functionality 48 inspect(object[, tabName]) 192 inspect(object[, tabName]) method 72 installation, FireBug on FireFox on non-Firefox browsers 10 install.rdf file 174 J JavaScript 172 JavaScript code debugging, with Firebug 83-85 JavaScript code navigation 102, 103 JavaScript Command 172 JavaScript debugging about 82 conditional breakpoints 85-88 with Firebug 83 JavaScript development command line API methods 67 console API methods 79 JavaScript Object Notation See  JSON [ 203 ] www.it-ebooks.info JavaScript profiler about 77 columns and description 78, 79 JSON 122 K keyboard and mouse shortcuts about 185 command line (large) shortcuts 189 command line (small) shortcuts 189 CSS editor tab shortcuts 188 CSS tab shortcuts 188 DOM and watch editor shortcuts 187 DOM tab shortcuts 187 global shortcuts 185 HTML editor shortcuts 186 HTML inspect mode shortcuts 186 HTML tab shortcuts 186 layout editor shortcuts 189 layout tab shortcuts 188 script tab shortcuts 187 keys(object) 192 keys(object) method 73 L layout editor shortcuts 189 layout tab shortcuts 188 M magical cd() function 137 monitorEvents(object[, types]) 192 monitorEvents(object[, types]) method 76 monitor(fn) 192 monitor(functionName) method 74, 75 MozRepl 172 multiline command line 70 N Net panel about 106 browser queue wait time 110 information 107, 108 load-time bar color significance 108, 109 request, breaking down by type 110, 111 net tab about 38 columns 38, 39 functions 38 network monitoring 106 non-Firefox browsers Firebug, installing on 10 O optionMenu() function 182 P page components inspecting 48 page edit inspecting 49 page reload inspecting 50 Page Speed about 162 rules 163 Page Speed Activity tab 165 Page Speed checks best practices 165, 166 Pixel Perfect about 153 configuration options 155 features 153 steps, for using 153, 154 prefs.js file 181 printMe()function 140 profileEnd() 192 profileEnd() method 77 profile([title]) 192 profile([title]) method 77 R registerPanel() function 177 request/response headers 120-122 rulesets, YSlow Classic (V1) 149 Small Site or Blog 149 YSlow (V2) 149 [ 204 ] www.it-ebooks.info S W script tab about 34 breakpoints, subtab 35 functions 34 stack, subtab 35 watch, subtab 34 script tab shortcuts 187 search box, Firebug 50 SenSEO about 160 features 160 rules 160 steps, for using 161 setPref method 182 SharedObject API 197 shortcut keys, Firebug configuring 143 SQLite Manager 172 172 web application performance analyzing 105 web application performance, analyzing browser cache, analyzing 113 HTTP headers, examining 112 network monitoring 106 requests, breaking down by type 110 XMLHttpRequest monitoring 116 window mode, Firebug modes 12 X XmlHttpRequest GET/POST request 125 request/response headers 120 tracking 120 XMLHttpRequest monitoring 116 XML User Interface Language See  XUL XPCOM components 197 XPCOM modules 197 XPCOMViewer 172 XUL 175 T TabWatcher/DOMWindowWatcher 197 U undebug(fn) 192 undebug(fn) method 74 unmonitorEvents(object[, types]) 192 unmonitorEvents(object[, types]) method 76 unmonitor(fn) 192 unmonitor(functionName) method 74, 75 URL parameter 122 V Y YSlow about 148 components tab 150 features 148 grade tab 149 rulesets 149 statistics tab 150 tools tab 151 values(object) 192 values(object) method 74 Venkman 172 ViewAbout 172 172 [ 205 ] www.it-ebooks.info .. .Firebug 1.5: Editing, Debugging, and Monitoring Web Pages Arm yourself to destroy UI and JavaScript bugs Chandan Luthra Deepak Mittal BIRMINGHAM - MUMBAI www.it-ebooks.info Firebug 1.5: Editing, ... What is Firebug • The history of Firebug • The need for Firebug • The capabilities of Firebug • Installing Firebug on different browsers • Opening and closing Firebug • Firebug modes What is Firebug? ... something goes wrong with Firebug while editing or debugging Firebug is a very powerful tool for inspecting, editing, and debugging; however, there are some issues and limitations of Firebug If we find

Ngày đăng: 24/04/2014, 15:12

Từ khóa liên quan

Mục lục

  • Cover

  • Copyright

  • Credits

  • About the Authors

  • About the Reviewers

  • Table of Contents

  • Preface

  • Chapter 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

        • Chapter 2: Firebug Window Overview

          • Console tab

            • Command line JavaScript

            • Errors and warnings

              • Status bar error indicator

              • Errors can be descriptive and informative

Tài liệu cùng người dùng

Tài liệu liên quan