Debugger Tool in Mozilla Firefox Browser
Last Updated :
29 Jul, 2024
Firefox provides a debugger in the DevTools to examine the JS code of the web page to inspect or find various bugs. You can add breakpoints to control the flow of execution and inspect various variables. All developers must know how to debug their code and since the debugger is easy to use it won't be a big task to learn.
Features of the Debugger Tool
The various features of the Debugger are:
- Search and filter option: You can search for certain file content or filter functions of the selected files. This option helps you to save time in searching for the required file or function. The search options support regular expression and case insensitive.
- Lists all js files: In the debugger tab you will have a sidebar displaying all the files under their respective URL. You have multi-tab support in the debugger to work on multiple files at the same time.
- Watching expressions: You can monitor JS variable values and expression values when you are stepping through the code. This helps to check for correct values and understand how these values change.
- Breakpoints and control buttons: You can have XHR, event listener, and dom mutation breakpoints and the debugger provides basic control buttons such as Resume/Pause, Step over, Step in, and Step out.
opening debuggerBenefits of the Debugger Tool
The various benefits of the debugger are:
- Understand and debug code: You can use the debugger to understand the code line by line and, if required, find bugs in the code. The debugger is simple to use and allows you to find bugs very easily.
- Inspect expressions and variables: You can check the values of specific variables or expressions by adding them to the underwatch expressions. It helps a lot in checking the changes in the values of the variables as the execution proceeds.
- Format option and color code: The code can be formatted to look clean and readable. The code is also viewable in color, which gives you an idea of various code constructs.
How to locate the Debugger in Firefox?
The Debugger is present in DevTools as a tab in the main toolbar. To open it, follow these steps:
Step 1: Using Firefox, visit the site where you want to use the debugger. Right-click on the site and then click Inspect from the context menu that appears.
Step 2: The DevTools will open, and there will be many tabs, and one of them will be Debugger. Click on it to open Debugger.
UI of the Debugger
The Debugger can be divided into three sections: the sources outline search pane, the code viewer, and the breakpoints pane.
UI of the Debugger1. Sources Outline Search pane
This pane provides three tabs that are sources, outline and search.
Various tabs in the pane- Sources Tab: This provides the list of all the js files under expandable trees which starts with the files origin. All these trees are under various thread categories.
Sources tab- Outline Tab: The outline tab provides you filter input bar to filter various functions present in the selected file.
Outline tab- Search Tab: Provides you a search bar to search for content in all the files of the web page. You also get options to enable regular expression input, match case with the input, and match whole word which means it match text beginning and ending with whitespace.
Search Tab2. Code viewer
This section views the code and provides option to format, ignore source and collapse/expand panes. You can click on line number to add breakpoint. You can right click the breakpoint to get a context menu which you can use to remove the breakpoint or disable it and you also get option to add conditional breakpoint and add log message.
Code Viewer- Expand/Collapse Sources, Outline, Search pane: The button is present in the top-left corner of the viewer which is used to show or hide the Sources, Outline, Search pane.
- Expand/Collapse Breakpoints pane: The button is present in the top-right corner of the viewer which is used to show or hide the Breakpoints pane.
- Ignore Source: This button is present in the bottom-left corner and is used to ignore of the current file to not be used in the execution.
- Pretty print source: This button appears as "{ }" is present in the bottom-left corner of the viewer which is used to prettify or format a minified file and opens in a new tab.
3. Breakpoints pane
This pane provides control buttons and multiple sub-panes or section of information about the breakpoints.
Breakpoints pane- Buttons
- Resume/Pause: Use it to resume or pause the debugger. You can also use the shortcut key F8.
- Step over: Use it to step to the next line of the executing code. You can also use the shortcut key F10.
- Step in: Use it to step in to a function of the executing code. You can also use the shortcut key F11.
- Step out: Use it to step out of the function of the executing code. You can also use the shortcut key Shift + F11.
- Deactivate breakpoints: You this button to disable all the breakpoints.
- Debugger Settings: This button provides a list of options to check/uncheck. These options are:
- Disable JavaScript: Check this option if you want to test the site without JavaScript.
- Inline Variable Preview: Check this option to display variables with there value at the end of the line when you step through the code.
- Wrap Lines: Check this option to wrap code to the next line in the code viewer.
- Source Maps: Check this option to show source maps in the Sources tab.
- Hide Ignored Sources: Check this option to hide the files in the Sources tab that were ignored.
- Ignore Known Third-party Scripts: Check this option to ignore 3rd party scripts.
- Sub-panes
- Threads: Provides the list of various threads of the web page.
- Watch expressions: You can use the add button to add expression and variable which values can be view under this pane.
- Breakpoints: Provides the list of breakpoints added. You also get checkboxes to pause on exceptions and pause on caught exceptions. You also have a bin option to remove all breakpoints.
- Call stack: Provides a expandable tree of functions that executed to reach the code.
- Scopes: Various values which come under the function, method, or event handler where the break occurred are mention under this pane.
- XHR Breakpoints: You can add URL or keywords which will break when a XHR request is made. If you have added a keyword then you can click the pause on any URL checkbox to break on these URL which contain the keyword.
- Event Listener Breakpoints: You get list of various events listener with checkboxes which can be check to add breakpoints for event handlers. You also have filter input to filter the event type and use the log checkbox to display information about events in the console tab.
- DOM Mutation Breakpoints: In the DOM section in elements tab you can add breakpoints to elements which break when modifications are done in the elements. The breakpoints are Subtree Modification, Attribute Modification and Node Removal which can be set by right clicking the elements and selecting the required breakpoints from break on menu. All the DOM breakpoints are listed under this pane which you can enable or disable by clicking on the checkbox or remove by clicking the cross icon.
Showing usage of the Debugger
Lets visit the GFG site and use the Debugger to inspect and debug.
Step 1: Visit the GFG site and locate the Debugger in the DevTools.
Step 2: Add the required breakpoints and use the controls to control the execution.
The developers can inspect or debug the JS code in the browser itself using the Debugger provide by Firefox browser. The tool provides various options to make the code easier to view and add breakpoints to control the flow of execution.
Similar Reads
Mozilla Firefox Browser Mozilla Firefox Browser is an open-source and free web browser. It is one of the most popular web browsers in the world, with over 200 million dynamic clients. Firefox is known for its speed, security, and security highlights. In this article, we will examine the highlights, and capacities of Firefo
5 min read
How to Download and Install Mozilla Firefox Browser on Windows? Mozilla Firefox is a web browser and it is built by Mozilla Corporation and it is free and open-source software. Its latest version is 71.0. It is available for a number of operating systems like Windows, Linux, Mac, etc. For displaying web pages it uses Gecko rendering engine. It was written in C,
3 min read
What is Mozilla Firefox Monitors ? Firefox is a web-based service provided by Mozilla. The service was developed by the popular browser Firefox. This service aims to protect the privacy of the user. Firefox Monitor was designed to help users check whether their email was compromised in any data breaches. This service focuses on prote
3 min read
Bookmark in Mozilla Firefox Browser A bookmark is a place holder for a web page that will create a shortcut for quick access to that web page. You can access that bookmark at any time instead of having to browse to it or enter long URLs. You can easily manage your bookmark lists as most browsers provide numerous advanced bookmarks fea
4 min read
Explain the architecture of Mozilla Firefox Browser Mozilla Firefox Browser is an open-source and free web browser. It is one of the most popular web browsers in the world, with over 200 million dynamic clients. Firefox is known for its speed, security, and security highlights. The Firefox browser is built on a modular architecture, meaning it's comp
3 min read
What is Tab Container 2.0 in Mozilla Firefox Browser? The term tab container is used to describe a feature that helps you organize & manage your tabs more effectively. It allows you to easily organize tabs into different boxes based on work, personal, study & shopping purposes. Each container runs on its own allowing you to keep your browsing s
3 min read
Lockwise feature in Mozilla FireFox Browser In this age of the increased significance of cyber security, the browser assumes greater significance in securing our virtual identity. Despite being one of the best web browsers in terms of performance with a friendly user interface, firefox has maintained itself as a leader in robust security aspe
3 min read
Mozilla Tabs and Tools
WebRender tabs in Mozilla Firefox BrowserWebRender Tabs is a feature in Firefox that enables the use of WebRender, a powerful GPU-accelerated rendering engine, for rendering tabs. This significantly improves the performance and responsiveness of Firefox, especially when dealing with a large number of tabs or complex web pages. Benefits of
3 min read
Inspector Tool in Mozilla FirefoxThe Inspector in Firefox is used to inspect and modify the HTML and CSS code of the web page. The inspector provides the DOM section, where you can view the HTML and modify the DOM by editing or deleting the elements. The inspector also displays the CSS code of the selected elements in the Rules pan
8 min read
Console Tool in Mozilla Firefox BrowserThe console in Firefox displays JS, CSS, XHR, and request issues, which can be used by developers to understand and debug issues on the web page. It is also used to execute JS code and manipulate the web page DOM.Table of ContentFeatures of the ConsoleBenefits of ConsolesHow do I open the console in
4 min read
Debugger Tool in Mozilla Firefox BrowserFirefox provides a debugger in the DevTools to examine the JS code of the web page to inspect or find various bugs. You can add breakpoints to control the flow of execution and inspect various variables. All developers must know how to debug their code and since the debugger is easy to use it won't
7 min read
Devtools in Mozilla Firefox BrowserFirefox provides a suite of tools for developers to use on their site. This tool lets developers edit styles, check for performance, check for responsiveness, check for the webpage's use of storage, and much more. These tools are in-built into the Firefox browser and provide easy access and a simple
7 min read
Mozilla Firefox for Developement
What is Firefox Developer Edition? Features, Benefits, and How to Use It in 2025Firefox Developer Edition is a special version of the Firefox browser designed specifically for web developers. It comes with additional tools, features, and customizations that are geared towards making the development and debugging process easier and more efficient. This version of Firefox provide
6 min read
Style Editor in Mozilla Firefox BrowserThe Firefox browser allows users to edit and create new styles on their web pages using the Style Editor. The Style Editor provides you with a space to edit and view the CSS used on the site. You can create your own CSS file or import it from your system. The Style Editor also allows you to save a C
4 min read
Responsive Design Mode in Mozilla Firefox BrowserAll web pages which are design for multiple devices having varying screen width must have a responsive design. These design can have relative layout and/or reflowing content. To inspect the responsive design of a web page Firefox provides a mode for simulating various screen sizes, throttling and to
4 min read
Performance Tab in Mozilla Firefox BrowserThe Performance Tab in Mozilla Firefox is an essential tool for developers and users who want to understand how the browser interacts with websites and web applications. This feature allows you to monitor the performance of your browser, track memory usage, and identify processes that may be slowing
10 min read
Memory Tab in Mozilla Firefox BrowserThe Memory Tab in Mozilla Firefox is a powerful tool for developers looking to analyze the memory usage of their browser and troubleshoot performance issues. By using the Memory tab in the Developer Tools, you can inspect how memory is being used by different tabs, extensions, and websites. This too
6 min read
How to .. in Mozilla Firefox
How to enable or disable multi-process mode in Firefox?Firefox, the popular web browser, utilizes a multi-process architecture known as Electrolysis (e10s) for improved stability and performance. By default, e10s is enabled, meaning each web page opens in its separate process, isolated from the main browser process. This helps prevent crashes and improv
2 min read
How to enable or disable spell check in Mozilla Firefox Browser?Firefox is a free open-source web browser developed by Mozilla Foundation and Mozilla Corporation. Firefox web browser has various features that are available in almost all the latest web browsers. Moreover, it has built-in features, multiple user logins, multiple tab opening, private mode browsing,
4 min read
How to enable or disable HTTPS-only mode in Firefox?HTTPS-Only Mode is a security feature in Firefox that helps protect your privacy and data by forcing all websites to use HTTPS. HTTPS is the secure version of HTTP, and it encrypts all traffic between your browser and the website you are visiting. This means that your data is protected from eavesdro
2 min read
How SpiderMonkey works in Mozilla Firefox Browser?Brendan Eich created the first JavaScript engine called Spider Monkey as early as 1995. This is the JavaScript execution environment at the heart of the Firefox web browser. Spider Monkey is an old brand name that was used even during the early days of JavaScript itself. Brendan Eich authored the or
3 min read
How to Browse in Mozilla Firefox ?Mozilla Firefox is a very popular web browser that is open-sourced and free to use. You can use this browser to visit sites, download various content, and use the web in a secure manner. In this article, you will learn about various features of Firefox that you can use to browse the web.Firefox Brow
5 min read