-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Feature Request: Chrome Extension for Direct Browser Tab Control
Summary
Add a Chrome extension (similar to Playwright's codegen/inspector) that allows users to interact with any open Chrome tab directly, without requiring --remote-debugging-port=9222 setup.
Motivation
Currently, DOMGuard requires:
- Starting Chrome with
--remote-debugging-port=9222 - Running commands from CLI
- Managing which tab is active
Pain points:
- Can't inspect existing browser sessions (e.g., authenticated tabs)
- Requires restarting browser with debugging flags
- No visual feedback in browser during automation
- Can't quickly switch between manual browsing and automation
Proposed Solution
Chrome Extension Features
-
Direct Tab Access
- Click extension icon to "connect" current tab to DOMGuard
- No need for remote debugging port
- Works with existing browser sessions
-
Visual Inspector (like Playwright)
- Hover over elements to highlight them
- Click to copy selector
- Right-click → "Inspect with DOMGuard" → generates CLI command
- Show element properties in extension popup
-
Action Recorder
- Click "Record" button in extension
- Perform actions manually (click, type, navigate)
- Extension generates DOMGuard CLI commands
- Copy/paste commands or save as workflow
-
Live Command Execution
- Extension popup has command input
- Execute DOMGuard commands directly from browser
- See results in extension popup
- Keep CLI workflow for automation
Example User Flow
Current workflow:
# Terminal
chrome --remote-debugging-port=9222
domguard interact click ".button"With extension:
- Browse to any page (already authenticated, no restart)
- Click DOMGuard extension icon
- Extension popup shows:
- "Inspect Element" mode (hover to see selectors)
- "Record Actions" button
- Command input field
- Recent commands history
- Click element → extension shows:
domguard interact click ".submit-btn" - Copy command for automation script
Technical Approach
Extension Architecture:
- Content Script: Injected into page for element inspection/highlighting
- Background Script: Manages tab connections, runs commands
- Popup UI: Command input, history, settings
- Native Messaging: Optional - communicate with CLI for advanced features
Compatibility:
- Keep existing CLI workflow (no breaking changes)
- Extension complements CLI, doesn't replace it
- Share same command syntax and options
Similar Tools Reference
Playwright Inspector
- Visual element picker
- Generates code automatically
- Records user actions
- https://playwright.dev/docs/codegen
Puppeteer Recorder (Chrome DevTools)
- Built into DevTools > Recorder tab
- Records flows, exports code
- Limited to Puppeteer API
DOMGuard Extension Advantages
- Simpler syntax than Playwright (standard CSS only)
- CLI-first design - extension generates CLI commands, not code
- Local-first - no external dependencies
- Lightweight - no Node.js, just Rust binary + extension
Benefits
For Developers
- ✅ Faster selector discovery (visual picking)
- ✅ No browser restart required
- ✅ Works with authenticated sessions
- ✅ Easier debugging (see what's being clicked)
For AI Agents
- ✅ Generate better selectors (visual validation)
- ✅ Record human demonstrations
- ✅ Quick element inspection without CLI back-and-forth
For QA Teams
- ✅ Record manual test flows → convert to automation
- ✅ Visual feedback during test execution
- ✅ Easier to teach non-technical users
Implementation Phases
Phase 1: Basic Extension (MVP)
- Element inspector (hover to highlight, show selector)
- Copy selector to clipboard
- Extension popup with basic info
Phase 2: Action Recorder
- Record clicks, typing, navigation
- Generate DOMGuard CLI commands
- Export as workflow script
Phase 3: Command Execution
- Run DOMGuard commands from extension
- Show results in popup
- Command history
Phase 4: Advanced Features
- Native messaging to CLI binary
- Screenshot annotations
- Design pattern extraction UI
- Workflow builder GUI
Alternatives Considered
- Keep CLI-only ❌ Requires debugging port, less discoverable
- Build full GUI app ❌ Too heavy, loses CLI simplicity
- Chrome Extension ✅ Best of both worlds
Questions
- Should extension work standalone or require CLI binary?
- Support for Firefox/Edge extensions?
- How to handle native messaging for advanced features?
Real-World Use Case
I tested DOMGuard on a Next.js app with Editor V3. The CLI workflow was excellent, but I had to:
- Find elements by trial and error (
document.querySelectorAll()) - Calculate coordinates manually for clicks
- No visual confirmation of what's being selected
With extension: I could visually inspect the page, click elements to get selectors, and immediately see what would be automated.
This feature would make DOMGuard significantly more accessible while maintaining its CLI-first philosophy.
Metadata
Metadata
Assignees
Labels
No labels