PAN Inspector - Chrome DevTools Extension
Professional debugging and inspection tool for Page Area Network (PAN) message bus.
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)
git clone https://github.com/larcjs/devtools.git
cd devtools
chrome://extensions/
- Enable "Developer mode" (top right)
devtools-extension/ folder
From Chrome Web Store (Coming Soon)
Once published, install directly from the Chrome Web Store.
Usage
Basic Usage
F12 or Right-click β Inspect
DevTools β PAN (tab)
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
#### 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
user.login message payloadTesting Error Handling
Performance Analysis
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: or // 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:Check console for errors
Look for "PAN DevTools" messages
"Extension not loading"
Check:chrome://extensions/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
chrome://extensions/ β Reloadexamples/17-enhanced-security.htmlDebugging
Background script:chrome://extensions/ β Inspect views: service worker
Content script:
DevTools β Console β Filter: [PAN DevTools]
Panel:
Right-click PAN tab β Inspect
Contributing
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
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
- π Documentation
- π Report Issue
- π¬ Discussions
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>
test.htmlEnjoy debugging with PAN Inspector! π