10x Developer
  • Introduction
  • HTML
    • HTML DOM Jquery
    • HTML: Form
    • CSS
    • CSS Layout
    • CSS Flexbox
    • CSS Grid
    • SASS/LESS
    • CSS/LESS/SASS Cookbook
    • Bootstrap
  • JavaScript
    • JavaScript
    • ES6
    • TypeScript
    • JavaScript Testing
    • JavaScript Event Loop
    • DOM
    • Web APIs
    • JSON
    • RegEx
    • Functional Programming
    • JavaScript Lib
    • CoffeeScript
    • CoffeeScript to ES6 cheatsheet
  • Angular.js
    • Angular
    • Angular Cookbook
    • Angular Mistakes I Made
    • Angular 1.x
  • React.js
    • React.js
  • Node
    • Node.js
    • CLI command line tool
    • Electron / Atom
    • NW.js (node-webkit)
  • Serverless
    • AWS Lambda
    • Google Cloud Function
    • Actions on Google / Google Assistant
  • Full Stack Development
    • HTTP
    • Meteor
    • MongoDB
    • Digital Ocean
    • UI
    • Sketch
    • Web Dev Resources
  • Lang
    • Ruby
  • Know Your Tools
    • Chrome DevTools
    • Editor: VS Code
    • Editor: Vim
    • Editor: Sublime
    • Editor: Atom
    • Windows
    • Git
    • Linux / Bash
    • Mac
  • Cheatsheets
Powered by GitBook
On this page
  • Hotkey
  • Elements
  • Network
  • Console
  • Debug
  • Chrome Extensions
  1. Know Your Tools

Chrome DevTools

PreviousKnow Your ToolsNextEditor: VS Code

Last updated 6 years ago

_

Hotkey

Remember all chrome related hotkeys are trigger with Option+CMD or ALT+CMD:

  • ALT+CMD+arrow: go to left or right tab

  • ALT+CMD+0: go to first tab

  • ALT+CMD+9: go to last tab

  • ALT+CMD+C: inspect element

  • ALT+CMD+i: open dev tools

Elements

  • F2 to edit as HTML, press again to apply the changes.

Network

  • filter the network by using -domain:*.com. See full list of filters by typing -.

  • How to capture network for new popup link? Go to

  • See XHRs in console: settings -> console -> check 'Log XMLHttpRequests'.

Console

  • $(selector)

    • returns the first element, is alias of docuemnt.querySelector()

  • $$(selector)

    • returns NodeList, is alias of docuemnt.querySelectorAll()

    • NodeList is not array, to convert to array: Array.prototype.slice.call(div_list) or [...div_list]

  • $0 is the selected element

Debug

Console: print and variable

  • dir(object)

  • keys(object)

  • table(data)

      var names = {
          0: { firstName: "John", lastName: "Smith" },
          1: { firstName: "Jane", lastName: "Doe" }
      };
      table(names);
  • store as global variable temp1: right click on an object in the console and press “store as global variable”

Find out events:

  • select element -> Event Listeners: find out existing handler for selected element.

    • for example, with unknown web app, you can find out what's happening after clicking a button.

  • console: monitor(function) outputs when this function is called and what arguments; unmonitor

  • console: monitorEvents(window, "resize")

  • sources -> Event Listener Breakpoints: you can add breakpoints for all kinds of events.

Block

  • Blackbox: on stack, you can also blackbox the whole script.

Node

  • debugger;

Chrome Extensions

  • feedly, evernote

postman:

http://www.cnblogs.com/Wayou/p/chrome-console-tips-and-tricks.html
chrome://net-internals/#events
Command Line API Reference for Chrome
nif
https://chrome.google.com/webstore/detail/builtwith-technology-prof/dapjbgnjinbpoindlpdmhochffioedbn
https://chrome.google.com/webstore/detail/merge-windows/adjadgadeebehakpgamlnafmdkegkmph
https://chrome.google.com/webstore/detail/web-developer-checklist/iahamcpedabephpcgkeikbclmaljebjp
http://chrispederick.com/work/web-developer/
http://chengyinliu.com/whatfont.html
https://chrome.google.com/webstore/detail/emmet-review/epejoicbhllgiimigokgjdoijnpaphdp
https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall
https://chrome.google.com/webstore/detail/postman-interceptor/aicmkgpgakddgnaphhhpliifpcfhicfo
https://chrome.google.com/webstore/detail/dimensions/baocaagndhipibgklemoalmkljaimfdj