

- #PROGRAMMING WITH CHROMIUM SOURCE CODE HOW TO#
- #PROGRAMMING WITH CHROMIUM SOURCE CODE CODE#
- #PROGRAMMING WITH CHROMIUM SOURCE CODE PC#
#PROGRAMMING WITH CHROMIUM SOURCE CODE CODE#
Log points are in effect console.log() without code! Right-click any line, choose Add log point, then add the expression:ĭOM breakpoints activate whenever JavaScript code changes a DOM node or its children. Rather than adding a standard breakpoint and clicking resume 999 times, you can right-click a line, choose Add conditional breakpoint, then enter an expression such as loopValue = 999.

Imagine you have a loop running from 0 to 999 and need to see the state at the last iteration. This activates the debugger when DevTools is open, so you should remove it from production code.Ĭonditional breakpoints check a value before halting execution. As well as manually defining breakpoints, you can add a debugger statement to your code. Pause on exceptions: halt processing when an error is raised.ĭevTools offers several more debugging options. Step: similar to step into, except it won’t jump into an async functionĭeactivate all breakpoints - useful if you want to temporarily run code without interruptions but don’t want to lose your breakpoints Step out: continue processing to the end of the function and return to the calling statement Step into: execute the next command and jump into any function it calls Step over: execute the next command but remain within the current function - do not jump into any function it calls Resume execution: continue processing until the next breakpoint or code termination Run your code - perhaps by refreshing the page or activating an event handler - and the code will halt at the breakpoint location:Ī Watch pane, where you can monitor specific variables by clicking the + icon and entering their nameĪ Breakpoints pane with all breakpoints and allows you to enable or disable anyĪ Scope pane displays the state of all local and global variables, andĪ Call Stack pane lists the functions called to reach this point in the code.Ī row of icons appears above the Paused on breakpoint message:įrom left to right, the icons perform the following actions: You can define any number of breakpoints, but you should only need to set them where you want to start debugging. Note you can also select files and add breakpoints in source maps which may be easier.Ī breakpoint specifies a point where the debugger will pause processing so you can inspect the state of the program and progress to the following line. You can open a JavaScript file from the Sources panel and click any line number to set a breakpoint (denoted by a blue marker). However, you can prettify minified code in the generated files by clicking the ) Debugging Client-Side Apps If your code defines source maps, you can open the “files” (see the src folder above) but changes will not apply to the active page. The yellow warning icon indicates that changes are not permanent. Press Ctrl | Cmd + S to save a file but be aware that it’s saved to memory. The Sources panel allows you to edit any CSS or JavaScript file by locating it in the Page pane. When viewing a page either on a local development or live site, the Elements panel allows you to inspect, disable, enable, add, edit, or remove any CSS selectors and properties: Safari and Firefox have different sets of features, and they may not offer the same editing functions, but they also have their own tricks to aid development for example, Firefox indicates which DOM elements have event handlers attached. Depending on your browser and OS, you can open DevTools from the menu: press F12, or Ctrl| Cmd + Shift + i. Chromium, Edge, Opera, Vivaldi, and Brave use the same engine and have the same tools.
#PROGRAMMING WITH CHROMIUM SOURCE CODE HOW TO#
The following sections describe how to use Chrome’s editing and debugging facilities.
#PROGRAMMING WITH CHROMIUM SOURCE CODE PC#
You’re unlikely to abandon VS Code or Sublime Text, but using a browser may be an option if you’re on someone else’s PC or need to edit a line or two.

There’s a daunting range of complex-looking features, but it’s reached a point where you could use Chrome as your complete development environment. Few developers delve too deeply into browser “DevTools”.
