Skip to content

allendm-msft/getNetworkTraces

Repository files navigation

Network Trace Reader Chrome Extension

A Chrome extension that can read and monitor network traces when opened in developer mode.

Features

  • Real-time Network Monitoring: Captures all network requests and responses in real-time
  • DevTools Integration: Adds a "Network Tracer" panel to Chrome DevTools
  • Detailed Request Information: Shows method, URL, status, type, size, and timing for each request
  • HAR Export: Export network traces in HAR (HTTP Archive) format for analysis
  • Request Filtering: View and analyze different types of network requests
  • Statistics Dashboard: Shows total requests, failed requests, and data transferred

Installation

  1. Open Chrome and navigate to chrome://extensions/
  2. Enable "Developer mode" in the top right corner
  3. Click "Load unpacked" and select the extension directory
  4. The extension icon will appear in the Chrome toolbar

Usage

Method 1: Using the Popup Interface

  1. Click the extension icon in the Chrome toolbar
  2. Click "Start Monitoring" to begin capturing network traces
  3. Browse the web normally - all network requests will be captured
  4. Click "Stop" to stop monitoring
  5. Use "Clear" to clear all captured data

Method 2: Using DevTools Panel (Recommended)

  1. Open Chrome DevTools (F12 or right-click → Inspect)
  2. Look for the "Network Tracer" tab in the DevTools panel
  3. Click "Start Recording" to begin capturing network traces
  4. Browse the web - all network activity will be displayed in real-time
  5. Use "Export HAR" to download network traces for external analysis

Features Overview

Network Request Monitoring

  • Captures all HTTP/HTTPS requests
  • Shows request methods (GET, POST, PUT, DELETE, etc.)
  • Displays response status codes with color coding
  • Records request/response timing information
  • Shows data transfer sizes

Developer Tools Integration

  • Custom DevTools panel for detailed analysis
  • Real-time request display
  • Request filtering and sorting capabilities
  • Export functionality for further analysis

Data Export

  • HAR (HTTP Archive) format export
  • Compatible with tools like:
    • Postman
    • Insomnia
    • HAR Analyzer
    • Chrome DevTools (import feature)

Technical Details

Permissions Required

  • activeTab: Access to the current active tab
  • debugger: Access to Chrome's debugging API for network monitoring
  • storage: Store extension settings and captured data

Architecture

  • Manifest V3: Uses the latest Chrome extension manifest version
  • Service Worker: Background processing for extension lifecycle
  • DevTools API: Integrates with Chrome's developer tools
  • Debugger API: Uses Chrome's debugger protocol to access network data

File Structure

chromextn/
├── manifest.json          # Extension configuration
├── background.js          # Service worker for background tasks
├── popup.html            # Extension popup interface
├── popup.js              # Popup functionality
├── devtools.html         # DevTools integration entry point
├── devtools.js           # DevTools panel creation
├── panel.html            # Network monitoring panel UI
├── panel.js              # Core network monitoring logic
└── icons/                # Extension icons
    ├── icon16.png
    ├── icon48.png
    └── icon128.png

Development

To modify or extend this extension:

  1. Edit the relevant files in the extension directory
  2. Reload the extension in chrome://extensions/
  3. Test the changes in a new tab or DevTools session

Key Components

  • Background Script: Handles extension lifecycle and message passing
  • Popup Interface: Provides quick access controls
  • DevTools Panel: Main interface for detailed network analysis
  • Network Monitoring: Uses Chrome's debugger API to capture network events

Troubleshooting

Extension Not Working

  1. Ensure Developer Mode is enabled in Chrome extensions
  2. Check that all required permissions are granted
  3. Reload the extension after making changes

No Network Data Showing

  1. Make sure "Start Recording" is clicked in the DevTools panel
  2. Verify that the debugger is properly attached to the tab
  3. Check the console for any error messages

DevTools Panel Not Visible

  1. Close and reopen DevTools
  2. Look for the "Network Tracer" tab (may be in the overflow menu)
  3. Ensure the extension is properly loaded and enabled

License

This extension is provided as-is for educational and development purposes.

Contributing

Feel free to submit issues and enhancement requests!

About

Chrome dev extension to get network traces

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published