Uname:Linux 7284066239a1 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64

Google Chrome Developer Tools (DevTools) – Prefr.co

🔍 How to Open DevTools

You can open DevTools in several ways:


🧭 Overview of the Main Panels in DevTools

Here are the most commonly used tabs/panels:

Elements Google Chrome Developer Tools
Elements Google Chrome Developer Tools

1. Elements

Console Google Chrome Developer Tools (DevTools)
Console Google Chrome Developer Tools (DevTools)

2. Console

Console Filter Options – The Console Sidebar filter in Chrome DevTools, helps you organize and filter the types of messages shown in the Console tab — especially useful when your app logs tons of data.

🔹 Messages: Shows all messages (a combination of errors, logs, warnings, etc.). This is the default view and the most verbose.
🔹 User Messages: Only shows console.log(), console.info(), and console.debug() that were explicitly written by developers.
🔹 Errors: Shows only console.error() messages or thrown JavaScript errors.
🔹 Warnings: Shows only console.warn() messages.Typically used for non-breaking issues or potential risks.
🔹 Info: Shows only console.info() messages. Slightly less noisy than log, often used for status updates.
🔹 Verbose: Shows everything, including things that normally don’t show up like: Internal debug messages, Detailed fetch logs, Framework-level debug info, Great for in-depth debugging, but can be noisy.

🛠️ Other Powerful Features of the Console Tab
🔹 Live Expression Watch
Click + beside “Live Expression” to monitor a variable in real time.
Great for seeing values change while your app runs.

🔹 Run JS Directly
You can execute any JavaScript code in the console.

🔹 Console Commands ($0, $_, etc.)
$0 → the element currently selected in the Elements tab.
$_ → last evaluated expression result.
$1, $2, … → previously selected elements in reverse order.
$$(‘selector’) → shorthand for document.querySelectorAll()

🔹 Group and Trace Logs
console.group(‘Label’) / console.groupEnd() → organize logs
console.trace() → shows a stack trace of where a log was called

🔹 Timers
Great for profiling performance.

🔹 Clear Console
Use the ⛔ icon or Ctrl + L / Cmd + K to clear the log output.

🔹 Preserve Log
Enable this option to keep logs even after page refresh — useful for debugging page loads.

🔹 Pro Tips
Use console.table() to display arrays/objects in table format.
Use custom style

Sources Google Chrome Developer Tools (DevTools)
Sources Google Chrome Developer Tools (DevTools)

3. Sources

The Sources tab in Chrome DevTools, which is a powerful live code editor and debugger for JavaScript and frontend developers. Let’s break down what all those sections mean so you can use them effectively is split into 3 main parts:

📁 LEFT: Page & Workspace (File Navigator)

🧑‍💻 MIDDLE: Code Editor

Displays the source file you’re currently inspecting. Here’s where you can:

🛠️ RIGHT: Debugging Tools

This is where the magic of debugging happens. Let’s break each section down:

🔁 Typical Debug Workflow

  1. Open Sources tab
  2. Navigate to main.js or similar from the Page panel
  3. Set a breakpoint on a suspicious line
  4. Trigger that part of the code (e.g., click a button)
  5. When it pauses, check:
    1. 🔍 Watch variables
    2. 🧭 Call Stack
    3. 🧮 Scope
    4. 🔁 Step through (F10, F11, etc.)
  6. Fix or tweak logic based on what you see
Network Google Chrome Developer Tools (DevTools)
Network Google Chrome Developer Tools (DevTools)

4. Network

Performance Google Chrome Developer Tools (DevTools)
Performance Google Chrome Developer Tools (DevTools)

5. Performance

Application Google Chrome Developer Tools (DevTools)
Application Google Chrome Developer Tools (DevTools)

6. Application

Security Google Chrome Developer Tools (DevTools)
Security Google Chrome Developer Tools (DevTools)

7. Security

Lighthouse Google Chrome Developer Tools (DevTools)
Lighthouse Google Chrome Developer Tools (DevTools)

8. Lighthouse

Memory Google Chrome Developer Tools (DevTools)
Memory Google Chrome Developer Tools (DevTools)

9. Memory

The Memory tab helps you:

Heap Snapshot

Good for:

Allocation Instrumentation on Timeline

Good for:

3. Allocation Sampling

Typical Workflow for Debugging Memory Leaks

Here’s how you’d typically use the Memory tab to find a leak:

Step 1: Take a Baseline Heap Snapshot

Step 2: Interact with the App

Step 3: Take Another Snapshot

Step 4: Look for Detached DOM Trees or Unexpected Objects

Step 5: Bonus Tips 🔧

Step 6: Example Workflow: Let’s say you’re debugging a broken button click:

  1. Go to Elements, locate the button and check if it’s visible and not disabled.
  2. Switch to Console, log messages or check for JS errors.
  3. Use Sources to place a breakpoint in your click handler.
  4. Open Network to see if clicking sends a request.
  5. Use Application to ensure any necessary data is stored correctly (cookies, localStorage).
  6. Run a Lighthouse audit to check performance or accessibility.