Skip to content

List of some useful Google Chrome developer tools commands

Notifications You must be signed in to change notification settings

markoch/chrome-commands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Google Chrome Console Commands

Interesting Google Chrome developer tools commands.

Editing

CommandDescription
document.body.contentEditable = trueMake web page editable

Select DOM elements

CommandDescription
$(<identifier>)Returns first matching identifier
$$(<identifier>)Returns all matching identifiers
$x(<xPath>)Returns array of XPath matches

Console Commands

CommandDescription
console.assert($("body").childNodes<1, "no content")Assertions
console.table([{a:1, b:2, c:3}, {a:"foo", b:false, c:undefined}]);Displays an array
console.log("%s has %d points", "Sam", 100);
console.warn("Node count:", a.childNodes.length)
console.error("Error message")
Log statements
console.count("Init for object" + obj);Count execution
dir(<element>)View object
dir($("body"))
inspect(<element>)Inspect element in Elements view

Events

CommandDescription
monitorEvents(<element>, );
unmonitorEvents(<element>, <event>);
Monitor events
monitorEvents(document.body, "click");
unmonitorEvents(document.body, "click");

Profiling

CommandDescription
console.time("Array initialize");
console.timeEnd("Array initialize");
Performance measurement
profile(<name>)
profileEnd(<name>)
CPU profiling

Reference

About

List of some useful Google Chrome developer tools commands

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published