An undetectable, human-like browser automation framework for macOS using virtual HID drivers
BrowserGeist provides stealth browser automation by simulating real human input through Core Graphics events, making it impossible for browsers to detect automation via traditional methods like navigator.webdriver or timing analysis.
- Uses Core Graphics event injection (not browser APIs)
- Human-like movement patterns with physics simulation
- Natural timing variations and behavioral randomness
- No
navigator.webdriverdetection - Bypasses sophisticated anti-automation measures
- Physics-based movement: Acceleration curves, velocity constraints, natural jitter
- Overshoot correction: Mimics human hand-eye coordination imperfections
- Multiple profiles: Careful, fast, natural movement patterns
- Fitts' Law compliance: Distance-based timing calculations
- Dwell time variation: Realistic pause patterns
- Template matching: OpenCV-based image recognition
- Feature detection: SIFT descriptors for robust matching
- OCR integration: Text recognition with pytesseract
- Multi-scale detection: Handles different image sizes
- Vision caching: Performance-optimized template storage
from browsergeist import HumanMouse, target
# Simple, intuitive API
bot = HumanMouse()
bot.move_to(target("login_button.png"))
bot.click()
bot.type("user@example.com", delay_profile="natural")βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Python SDK βββββΆβ Control Daemon βββββΆβ Core Graphics β
β (User Scripts) β β (Swift/IPC) β β (OS Events) β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Vision Module β β Human Motion β β Input Injection β
β (OpenCV/OCR) β β Engine β β (Mouse/Keyboard)β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
# Install uv package manager (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install Python dependencies
make python
# Build the control daemon
make build
# Sign with entitlements (optional)
make signRequired macOS permissions:
- Accessibility: System Preferences β Privacy & Security β Accessibility
- Screen Recording: System Preferences β Privacy & Security β Screen Recording
- Input Monitoring: System Preferences β Privacy & Security β Input Monitoring
# Start the background daemon
make daemon#!/usr/bin/env python3
from browsergeist import HumanMouse, MotionProfiles
# Initialize with human-like behavior
bot = HumanMouse()
# Navigate with vision
bot.move_to(target("search_box.png"))
bot.click()
# Type naturally
bot.type("BrowserGeist automation", delay_profile="natural")
# Submit with careful movement
bot.move_to(target("submit_button.png"), profile=MotionProfiles.CAREFUL)
bot.click()# Predefined human behavior patterns
MotionProfiles.NATURAL # Balanced speed and accuracy
MotionProfiles.CAREFUL # Slow, precise movements
MotionProfiles.FAST # Quick, efficient navigation
# Custom profiles
custom_profile = MotionProfile(
name="custom",
max_velocity=600.0,
acceleration=1800.0,
jitter_amount=1.5,
overshoot_chance=0.1,
dwell_time_min=0.03,
dwell_time_max=0.07
)# Template matching
bot.move_to(target("element.png"))
# Coordinate targeting
bot.move_to((x, y))
# Text recognition (requires pytesseract)
bot.move_to(find_text("Login"))
# Advanced matching options
result = bot.find_template("button.png", confidence=0.9, method="feature")# Mouse operations
bot.click(button="left", duration=0.05)
bot.scroll(dx=0, dy=100, smooth=True)
bot.move_to((800, 400))
# Keyboard operations
bot.type("Hello World", delay_profile="average")
bot.press_key("Enter")
bot.key_combo(["Cmd", "A"])# Fine-tune human-like behavior
motion_config = {
"max_velocity": 800.0, # pixels/second
"acceleration": 2000.0, # pixels/secondΒ²
"jitter_amount": 2.0, # random displacement
"overshoot_chance": 0.15, # probability of overshoot
"dwell_time_range": (0.02, 0.08) # pause duration range
}# Template matching parameters
vision_config = {
"confidence_threshold": 0.8,
"matching_method": "auto", # "template", "feature", "auto"
"cache_templates": True,
"cache_ttl": 60.0
}- No browser automation frameworks: Bypasses Selenium/Playwright detection
- Hardware-level simulation: Uses OS input system, not JavaScript injection
- Human timing patterns: Eliminates robotic click intervals
- Natural cursor paths: Physics-based movement with imperfections
- Randomized behavior: Varies timing, paths, and interaction patterns
β
navigator.webdriver - Not set (uses OS events)
β
DevTools detection - Not applicable (no browser API usage)
β
Timing analysis - Human-like randomization
β
Mouse tracking - Natural acceleration and jitter
β
Click patterns - Variable duration and placement
# Run comprehensive demo (with virtual environment)
./run_example.sh examples/browser_automation_demo.py
# Or manually activate virtual environment first
source .venv/bin/activate
python3 examples/browser_automation_demo.py
# Test specific components
make test- β Safari - Full compatibility
- β Chrome - Full compatibility
- β Firefox - Full compatibility
- β Edge - Full compatibility
- macOS 10.15+ (Catalina or later)
- Python 3.8+
- uv package manager (
curl -LsSf https://astral.sh/uv/install.sh | sh) - Xcode Command Line Tools
uv pip install opencv-python numpy pillow pytesseract- pytesseract: For OCR text recognition
- Tesseract: System OCR engine (
brew install tesseract)
β "Failed to connect to daemon"
# Start the daemon first
make daemon
# Check if running
ps aux | grep browsergeistβ "Accessibility permissions not granted"
- Add terminal/app to System Preferences β Privacy & Security β Accessibility
- Restart terminal after granting permissions
β "Screen capture failed"
- Grant Screen Recording permissions
- Restart the daemon after permission changes
β "Vision system not available"
# Install OpenCV
uv pip install opencv-python
# For OCR features
brew install tesseract
uv pip install pytesseract- Automated testing: QA workflows and regression testing
- UI automation: Repetitive desktop tasks
- Accessibility tools: Assistive technology development
- Research: Human-computer interaction studies
- Development: Browser testing and validation
- Respect website terms of service
- Don't overwhelm servers with requests
- Use for testing your own applications
- Consider rate limiting for external sites
- Always disclose automation in production
MIT License - see LICENSE for details.
Contributions welcome! Please read our contributing guidelines and submit pull requests for any improvements.
- Latency: < 10ms event injection
- Accuracy: 99%+ template matching
- Memory: < 50MB daemon footprint
- CPU: Minimal impact during idle
BrowserGeist - Where automation meets humanity π€β¨