Debugger(Firefox)/ Sources(Chrome)

The Sources/Debugger UI panel watches JavaScript code and allows you to set breakpoints and watch the value of variables. Breakpoints are set at the places in the code where we want to pause the execution cycle and debug or identify the problems with the execution. With this panel, you debug the JavaScript.

This panel has three parts:

1.  File list(Firefox)/ File Navigator(Chrome): Lists every file associated with the page that we are debugging.

2.  Source code(Firefox)/ Code Editor(Chrome): Contents of the selected file is displayed in this panel. Breakpoints could also be set in this panel, where we want to pause execution.

3. Watch expressions and breakpoints: These are the tools for inspecting the JavaScript of the page.

There are two more sections that only appear when the code is running.

4. Call Stack: It shows you what code was executed to get to the current line.

5. Scopes: It shows the values which are visible from a different perspective from within the given code.

Application:

  • Pause code with breakpoints.
  • Save changes to disk with workspaces.
  • Run snippets of code from any page.
  • Find unused JavaScript.
  • Persist changes across page reloads with local overrides.
  • Get a JavaScript debugging reference.

Browser Developer Tools

Every web-developer needs some basic set of tools for understanding the underlying structure of the code and enables us to inspect the web content. Developer tools are built directly into the browser. These are the tools that are browser dependent. Most of these tools are common among various browsers and do a range of things, from inspecting elements of a currently-loaded HTML, CSS, and JavaScript. With developer tools, we can directly interact with the source code that is fetched into the client side of our system. This article will explain such basic functionality of the browser’s devtools.

Across all browsers, the basic functionality of the developer tools remains the same, only naming conventions and terminologies changes. In this article, we would be focusing the majority of sections on two popular browsers Firefox and Chrome.

Similar Reads

How to open DevTools in the browser

There are many ways to open the Browser Developer Tools....

1. Inspector

The Inspector tool allows you to see the HTML, CSS of the webpage that you are currently inspecting. With it, you can check what CSS is applied to each element on the page. It also allows you to preview instant changes to the HTML and CSS which are reflected live in the browser. These changes are not permanent and are reset once you refresh the browser window....

2. Console

The console is used for debugging JavaScript present in the source code of the webpage. The console window act as our debug window that allows us to handle JavaScript that isn’t working as expected. It allows you to either run a code block or single lines of JavaScript against the page which is currently loaded in the browser. The console reports the errors which are encountered by the browser as it tries to execute the code....

3. Debugger(Firefox)/ Sources(Chrome)

The Sources/Debugger UI panel watches JavaScript code and allows you to set breakpoints and watch the value of variables. Breakpoints are set at the places in the code where we want to pause the execution cycle and debug or identify the problems with the execution. With this panel, you debug the JavaScript....

3. Network Monitor

A Network panel is used to make sure what all resources that are being downloaded or uploaded are being done as expected. It enables us to view the network requests made when a page is loaded. It tells how long each request takes, and details of each request. The monitor is empty when it is loaded, the logs are created once any action is performed while the monitor is open....

4. Performance Tools

Performance is recorded at runtime and tells how the page performs when it is running, as opposed to loading. The tool gives a general insight into how good is the site’s general responsiveness. It also measures the JavaScript & layout performance of the site. The tool creates a recording/ profile, of the website over a period of time, the tool is made to run. An overview is created using the RAIL model, listing all the frames of the browser activity which has been done to render the website....

5. Accessibility Inspector

This tool provides a way to access important information which is generally exposed to the assistive tech stack on the current view page via the accessibility tree present. It allows checking what element is missing or otherwise needs attention....