Skip to content

Instantly share code, notes, and snippets.

@matthewblewitt
Last active June 20, 2018 13:14
Show Gist options
  • Save matthewblewitt/c1f1e1a9b2900e364aeffe1e36ddc30e to your computer and use it in GitHub Desktop.
Save matthewblewitt/c1f1e1a9b2900e364aeffe1e36ddc30e to your computer and use it in GitHub Desktop.
Chrome dev tools javascript tips

Find any file CMD+P Find function by keyword CMD+SHIFT+O Go to any location in dev tools CMD+SHIFT+P

Console tips

Clear console CMD+L.

Get event listeners by selector

var el = document.getElementById('#myEl');
getEventListeners(el);
// Output: {click: Array(1)}

Monitor events by selector

var el = document.getElementById('#myEl');
monitorEvents(el, ['click']);
unmonitorEvents(el);

Add breakpoint to function

debug(myFunction);
undebug(myFunction);

Monitor function

monitor(myFunction);
unmonitor(myFunction);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment