chrome-driver
A Claude Code plugin that enables LLMs to interact with web pages through Chrome DevTools Protocol, implemented in pure Perl with no external dependencies.
Features
- Browser Automation: Navigate, click, type, interact with web pages
- Content Extraction: Extract HTML, text, or markdown from pages
- Visual Capture: Take screenshots (PNG, JPEG, WebP)
- PDF Generation: Convert pages to PDF with full control
- JavaScript Execution: Run JavaScript in browser context
- Session Management: Save/load cookies and authentication state
- Zero Dependencies: Pure Perl 5.14+ with standard modules only
Installation
Prerequisites
- Perl 5.14 or later (included with macOS/Linux)
- Chrome or Chromium browser
Install Plugin
Via Focus Marketplace (Recommended):
# Add the Focus marketplace (if not already added)
/plugin marketplace add The-Focus-AI/claude-marketplace
# Install the plugin
/plugin install chrome-driver@focus-marketplace
Then restart Claude Code.
Manual Installation:
# Clone repository
git clone https://github.com/The-Focus-AI/chrome-driver
cd chrome-driver
# The plugin is self-contained in .claude-plugin/
# Point Claude Code to this directory or copy to your plugins location
Quick Start
Use with Claude Code
Simply ask Claude to interact with websites:
> Take a screenshot of example.com
> Extract the text from https://news.ycombinator.com
> Generate a PDF of this page
> Fill out the login form at https://example.com/login
The browser-automation skill will automatically activate.
Slash Commands
Quick commands for common tasks:
/browser # Check browser status
/screenshot URL # Take screenshot
/pdf URL # Generate PDF
/extract URL # Extract content
/navigate URL # Navigate and interact
/interact # Multi-step interactions (no page reload)
/form URL # Fill and submit forms
/record URL DIR # Record screencast frames
/cookies # Manage sessions
Direct Perl Usage
use ChromeDriver;
use Page::Navigation;
use Content::Extraction;
# Start browser
my $chrome = ChromeDriver->new(headless => 1);
$chrome->connect_to_page() or die $chrome->error;
# Navigate
my $nav = Page::Navigation->new(chrome => $chrome);
$nav->goto('https://example.com');
# Extract content
my $content = Content::Extraction->new(chrome => $chrome);
my $markdown = $content->markdown();
my @links = $content->links();
# Clean up
$chrome->close();
Modules
| Module | Purpose |
|---|
ChromeDriver | Core CDP connection and messaging |
Page::Navigation | Navigate, reload, history |
Content::Extraction | Extract HTML, text, markdown, links, images |
Visual::Capture | Screenshots and viewport control |
Print::PDF | PDF generation with full options |
DOM::Elements | Query, click, type, interact with elements |
JS::Execute | Execute JavaScript in browser |
Session::Cookies | Cookie management and persistence |
Help::Browser | Interactive help system |
Examples
Scrape Website Content
use ChromeDriver;
use Page::Navigation;
use Content::Extraction;
my $chrome = ChromeDriver->new(headless => 1);
$chrome->connect_to_page();
my $nav = Page::Navigation->new(chrome => $chrome);
my $content = Content::Extraction->new(chrome => $chrome);
$nav->goto('https://example.com');
my $text = $content->text('article');
my @links = $content->links();
print "Content: $text\n";
print "Found " . scalar(@links) . " links\n";
$chrome->close();
Fill Form and Submit
use ChromeDriver;
use Page::Navigation;
use DOM::Elements;
my $chrome = ChromeDriver->new(headless => 1);
$chrome->connect_to_page();
my $nav = Page::Navigation->new(chrome => $chrome);
my $dom = DOM::Elements->new(chrome => $chrome);
$nav->goto('https://example.com/login');
$dom->type('input[name="email"]', 'user@example.com');
$dom->type('input[name="password"]', 'secret');
$dom->click('button[type="submit"]');
$dom->wait_for('.dashboard', 10);
print "Logged in successfully!\n";
$chrome->close();
Generate PDF Report
use ChromeDriver;
use Page::Navigation;
use Print::PDF;
my $chrome = ChromeDriver->new(headless => 1);
$chrome->connect_to_page();
my $nav = Page::Navigation->new(chrome => $chrome);
my $pdf = Print::PDF->new(chrome => $chrome);
$nav->goto('https://example.com/report');
$pdf->a4(
file => '/tmp/report.pdf',
margin => 1,
print_background => 1
);
print "PDF saved to /tmp/report.pdf\n";
$chrome->close();
Take Full-Page Screenshot
use ChromeDriver;
use Page::Navigation;
use Visual::Capture;
my $chrome = ChromeDriver->new(headless => 1);
$chrome->connect_to_page();
my $nav = Page::Navigation->new(chrome => $chrome);
my $capture = Visual::Capture->new(chrome => $chrome);