Key Tools for Debugging
1. Console Tab: Check JavaScript Errors
Steps:
- Open DevTools:
- Windows:
F12orCtrl + Shift + I - Mac:
Cmd + Option + I
- Windows:
- Go to the Console tab to view errors/warnings.
2. Network Tab: Analyze Load Times
Steps:
- Open the Network tab in DevTools.
- Reload the page to see all network requests.
- Look for:
- Red entries (failed requests).
- Large files (e.g., uncompressed images).
3. Elements Tab: Inspect HTML/CSS
Steps:
- Right-click any page element → Inspect.
- Edit HTML/CSS live to test fixes (changes are temporary).
4. Sources Tab: Debug JavaScript
Steps:
- Open the Sources tab.
- Select a JavaScript file.
- Click line numbers to set breakpoints (pause code execution).
5. Performance Tab: Analyze Page Speed
Steps:
- Open the Performance tab.
- Click Record → interact with the page → stop recording.
- Analyze metrics like
FCP(First Contentful Paint) andLCP(Largest Contentful Paint).
Pro Tips
- Use
debugger;in JavaScript to pause execution. - Test mobile responsiveness with Device Emulation (toggle device icon).
- Use React Developer Tools for React apps.
Note: Shortcuts like
Ctrl + Shift + C (Windows) or Cmd + Shift + C (Mac) open the Elements tab directly.