Command Line API
The Firebug Command Line provides these special functions for your convenience. These include functions to control the Firebug UI, functions interacting with the page, shortcuts for selectors and shortcuts for the Console API. Other browsers implement the Command Line API as well; the Chrome DevTools, Safari Inspector and Opera Dragonfly, implement most of what is below.
- 1 help
- 2 $(id)
- 3 $$(selector)
- 4 $x(xpath)
- 5 $0
- 6 $1
- 7 $n(index)
- 8 dir(object)
- 9 dirxml(node)
- 10 cd(window)
- 11 clear()
- 12 copy(object)
- 13 inspect(object[, panelName])
- 14 keys(object)
- 15 values(object)
- 16 include(url[, alias]) / include(alias)
- 17 debug(fn)
- 18 undebug(fn)
- 19 monitor(fn)
- 20 unmonitor(fn)
- 21 monitorEvents(object[, types])
- 22 unmonitorEvents(object[, types])
- 23 profile([title])
- 24 profileEnd()
- 25 table(data[, columns])
- 26 traceCalls(fn)
- 27 untraceCalls(fn)
- 28 traceAll()
- 29 untraceAll()
Returns a list of Command Line API commands including short descriptions.
Returns a single element with the given id.
Warning: it will ultimately change to return the first match for the given CSS selector.
Returns an array of elements that match the given CSS selector.
Returns an array of elements that match the given XPath expression.
Represents the last element selected via the Inspector.
Represents the second last element selected via the Inspector.
Returns one of the 5 last elements selected via the Inspector. This method takes one required parameter
index, which represents the index of the element (starting at 0).
Prints an interactive listing of all properties of the object. This looks identical to the view that inside the DOM Panel.
Prints the XML source tree of an HTML or XML element. This looks identical to the view inside the HTML Panel. You can click on any node to inspect it in the HTML panel.
By default, command line expressions are relative to the top-level window of the page. cd() allows you to use the window of a frame in the page instead.
Clears the console.
Copies the given parameter to the clipboard. This can be a return value of a function or an object.
Inspects an object in the most suitable panel, or the panel identified by the optional argument
The available tab names are "html", "stylesheet", "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.
Includes a remote script.
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 define specific events or event types to log.
Turns off logging for all events dispatched to an object. The optional argument
types may define specific events or event families, for which to turn logging off.
For a list of available event families see monitorEvents(object[, types]).
title contains the text to be printed in the header of the profile report.
This is a shortcut for
Enables tracing of specific function calls.
Disables tracing of specific function calls.
Enables tracing of function calls for a whole context.
Disables tracing of function calls for a whole context.