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 |
Purpose |
---|---|
|
Returns a single element with the given ID |
|
Returns an array of elements that match the given CSS selector. |
|
Returns an array of elements that match the given XPath expression. |
|
Prints an interactive listing of all properties of the object. This looks identical to the view that we would see in the DOM tab. |
|
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. |
|
By default, command line expressions are relative to the top-level window of the page. |
|
Clears the console. |
|
Inspects an object in the most suitable tab, or the tab identified by the optional argument The available tab names are HTML, CSS, SCRIPT, and DOM. |
|
Returns an array containing the names of all properties of the object. |
|
Returns an array containing the values of all properties of the object. |
|
Adds a breakpoint on the first line of a function. |
|
Removes the breakpoint on the first line of a function. |
|
Turns on logging for all calls to a function. |
|
Turns off logging for all calls to a function. |
|
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. |
|
Turns off logging for all events dispatched to an object. |
|
Turns on the JavaScript profiler. The optional argument title would contain the text to be printed in the header of the profile report. |
|
Turns off the JavaScript profiler and prints its report. |