Index of /site/docs/devtools

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[TXT]BUILD_ICONS.html2026-01-11 14:51 5.2K 
[TXT]CHROME_DEVTOOLS_MCP_EXTENSION_SETUP.html2026-01-11 14:51 9.2K 
[TXT]EXTENSION_ENABLED.html2026-01-11 14:51 13K 
[TXT]EXTENSION_TEST_PLAN.html2026-01-11 14:51 16K 
[TXT]EXTENSION_TEST_RESULTS.html2026-01-11 14:51 12K 
[TXT]QUICKSTART.html2026-01-11 14:51 7.6K 
[TXT]QUICK_START.html2026-01-11 14:51 5.8K 
[TXT]README.html2026-01-11 14:51 14K 
[TXT]RESTART_REQUIRED.html2026-01-11 14:51 7.3K 
[TXT]ROOT_CAUSE_FOUND.html2026-01-11 14:51 8.3K 

PAN Inspector - Chrome DevTools Extension Β· PAN Documentation
Home / devtools / README

PAN Inspector - Chrome DevTools Extension

Professional debugging and inspection tool for Page Area Network (PAN) message bus.

!PAN Inspector Screenshot

Features

πŸ” Real-Time Message Monitoring

  • Captures all PAN messages (publish, deliver, subscribe)
  • Shows message details: topic, data, timestamp, target, size
  • Color-coded message types for quick identification

🎯 Powerful Filtering

  • Filter by topic, type, or data content
  • Toggle message types on/off
  • Search across all message properties

πŸ“Š Message Inspector

  • Detailed view of message payload
  • JSON formatting with syntax highlighting
  • Copy message as JSON

πŸ”„ Message Replay

  • Replay any captured message
  • Perfect for debugging and testing
  • Works with live applications

πŸ’Ύ Export/Import

  • Export message logs as JSON
  • Import logs for analysis
  • Share debugging sessions with team

⏸️ Recording Control

  • Pause/resume message capture
  • Clear message history
  • Real-time message counter

Installation

From Source (Development)

  • Clone the repository:
  • git clone https://github.com/larcjs/devtools.git
       cd devtools
  • Open Chrome Extensions:
  • - Navigate to chrome://extensions/ - Enable "Developer mode" (top right)
  • Load extension:
  • - Click "Load unpacked" - Select the devtools-extension/ folder
  • Verify installation:
  • - Open Chrome DevTools (F12) - Look for the "PAN" tab

    From Chrome Web Store (Coming Soon)

    Once published, install directly from the Chrome Web Store.


    Usage

    Basic Usage

  • Open DevTools on any page with PAN bus:
  • F12 or Right-click β†’ Inspect
  • Switch to PAN tab:
  • DevTools β†’ PAN (tab)
  • Interact with the page:
  • - Messages appear in real-time - Click any message to see details

    Features Walkthrough

    #### Filtering Messages

    Text Search:
    Type in filter box: "user.login"
    β†’ Shows only messages matching "user.login"
    By Type:
    Uncheck "Publish" β†’ Hides all publish events
    Uncheck "Subscribe" β†’ Hides all subscribe events
    Combined:
    Search "error" + Uncheck "Deliver"
    β†’ Shows only publish/subscribe with "error" in data

    #### Viewing Message Details

  • Click any message row
  • Details panel opens on right
  • See:
  • - Complete message structure - Formatted JSON payload - Message metadata

    #### Replaying Messages

    From table:
    Click "Replay" button β†’ Message sent again
    From details panel:
    1. Select message
    2. Click "Replay Message"
    3. Message dispatched on page
    Use Case:
    Test how components handle specific messages
    without needing to trigger the action again

    #### Export/Import

    Export:
    1. Click "Export" button
    2. Save JSON file
    3. Share with team or keep for records
    Import:
    1. Click "Import" button
    2. Select JSON file
    3. Messages loaded into inspector
    Use Case:
    - Reproduce bugs from production logs
    - Share debugging sessions
    - Compare message flows

    Examples

    Debugging a Login Flow

  • Open PAN Inspector
  • Clear messages
  • Perform login
  • Filter by "user" to see login-related messages
  • Inspect user.login message payload
  • Verify authentication data
  • Testing Error Handling

  • Capture an error message
  • Export to JSON file
  • Modify payload to test edge cases
  • Import modified messages
  • Replay to component
  • Performance Analysis

  • Monitor message frequency
  • Check message sizes
  • Identify bottlenecks
  • Look for unexpected message storms

  • Keyboard Shortcuts

    | Key | Action | |-----|--------| | Ctrl/Cmd + K | Focus filter input | | Ctrl/Cmd + L | Clear messages | | Esc | Close details panel | | Space | Pause/Resume recording |


    Troubleshooting

    "No messages appearing"

    Check:
  • βœ… Page uses or
  • βœ… Components are publishing messages
  • βœ… Recording is not paused
  • βœ… Filters are not hiding messages
  • Solution:
    // Test in console
    import { PanClient } from './pan/core/pan-client.mjs';
    const client = new PanClient();
    client.publish({ topic: 'test', data: { hello: 'world' } });
    // Should appear in PAN Inspector

    "Replay not working"

    Check:
  • βœ… Content script is injected
  • βœ… Page has PAN bus
  • βœ… Message is valid
  • Debug:
    Check console for errors
    Look for "PAN DevTools" messages

    "Extension not loading"

    Check:
  • βœ… Chrome version 88+ (Manifest V3)
  • βœ… All files present in extension folder
  • βœ… No errors in chrome://extensions/
  • Solution:
    Reload extension:
    chrome://extensions/ β†’ Click reload icon

    Architecture

    Message Flow

    Page Context (PAN Bus)
       ↓ (CustomEvent intercept)
    Injected Script (src/injected.js)
       ↓ (postMessage)
    Content Script (src/content-script.js)
       ↓ (chrome.runtime.sendMessage)
    Background Service Worker (src/background.js)
       ↓ (port.postMessage)
    DevTools Panel (panel.html/js)
       ↓ (Render)
    User Interface

    Files Overview

    devtools-extension/
    β”œβ”€β”€ manifest.json          # Extension config (Manifest V3)
    β”œβ”€β”€ devtools.html/js       # DevTools entry point
    β”œβ”€β”€ panel.html             # Main UI
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ devtools.js        # Panel creator
    β”‚   β”œβ”€β”€ background.js      # Message router
    β”‚   β”œβ”€β”€ content-script.js  # Bridge script
    β”‚   β”œβ”€β”€ injected.js        # Page context interceptor
    β”‚   └── panel.js           # UI logic
    β”œβ”€β”€ styles/
    β”‚   └── panel.css          # DevTools-style UI
    └── icons/
        └── icon-*.png         # Extension icons

    Development

    Building

    No build step required! Pure JavaScript.

    Testing

  • Make changes to source files
  • Reload extension: chrome://extensions/ β†’ Reload
  • Reload DevTools panel: Right-click panel β†’ Reload
  • Test with examples/17-enhanced-security.html
  • Debugging

    Background script:
    chrome://extensions/ β†’ Inspect views: service worker
    Content script:
    DevTools β†’ Console β†’ Filter: [PAN DevTools]
    Panel:
    Right-click PAN tab β†’ Inspect

    Contributing

  • Fork the repository
  • Create feature branch
  • Make changes
  • Test thoroughly
  • Submit pull request

  • Roadmap

    v1.1

    • [ ] Timeline view (visual message flow)
    • [ ] Performance metrics
    • [ ] Message stats dashboard
    • [ ] Dark mode toggle

    v1.2

    • [ ] Network waterfall view
    • [ ] Message diff tool
    • [ ] Breakpoints on topics
    • [ ] Advanced filters (regex, JSON path)

    v1.3

    • [ ] Record/replay sessions
    • [ ] Test generation from recordings
    • [ ] Playwright integration
    • [ ] Export to HAR format

    Known Issues

  • Messages before DevTools open - Can't capture messages sent before DevTools opens (by design)
  • Large message counts - UI slows down with 10,000+ messages (limited to last 1,000 rendered)
  • Cross-origin iframes - Can't inspect messages in cross-origin iframes (security restriction)

  • Browser Support

    • βœ… Chrome 88+ (Manifest V3)
    • βœ… Edge 88+ (Chromium-based)
    • ⏳ Firefox (Coming soon - needs Manifest V2 version)
    • ❌ Safari (Not supported - WebExtensions API differences)

    Privacy

    This extension:

    • βœ… Does NOT collect any data
    • βœ… Does NOT make external network requests
    • βœ… Does NOT track usage
    • βœ… Only runs on pages you inspect
    • βœ… All data stays local in DevTools

    License

    MIT License - Same as PAN framework


    Credits

    Built with ❀️ by the PAN team

    Inspired by:

    • Chrome DevTools Network panel
    • Redux DevTools
    • Vue DevTools

    Support


    Quick Start Example

    <!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8">
      <title>PAN Inspector Test</title>
    </head>
    <body>
      <script type="module" src="../pan-bus.mjs"></script>
      <script type="module" src="../pan-client.mjs"></script>
    
      <pan-bus></pan-bus>
    
      <button id="test-btn">Send Test Message</button>
    
      <script type="module">
        import { PanClient } from '../pan-client.mjs';
    
        const client = new PanClient();
        await client.ready();
    
        document.getElementById('test-btn').onclick = () => {
          client.publish({
            topic: 'test.click',
            data: { timestamp: Date.now() }
          });
        };
    
        // Subscribe to see it work
        client.subscribe('test.*', (msg) => {
          console.log('Received:', msg);
        });
      </script>
    </body>
    </html>
  • Save as test.html
  • Open in Chrome
  • Open DevTools β†’ PAN tab
  • Click "Send Test Message"
  • See message appear in inspector!

  • Enjoy debugging with PAN Inspector! πŸš€