Improve keyboard typing and screenshot verification#6
Merged
Conversation
- Add keyboard_type() method for reliable typing into any element type - Wrapper for Playwright keyboard API - Works with contenteditable divs (X.com, Medium, etc) - Returns system reminder to verify with screenshot - Update take_screenshot() with verification guidance - Add 1-second wait after screenshot to prevent focus loss - Add full_page parameter for complete page capture - System reminder about full-page vs targeted screenshots - Explains lazy loading and detail trade-offs - Add browser_config.py with browser-use anti-detection settings - 53 Chrome args for anti-bot detection - 30 disabled features including AutomationControlled - Synced from connectonion/cli/browser_agent/browser_config.py - Remove type_text() method (replaced by keyboard_type) Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
- Add wait() method for simple timeouts - Add get_current_url() to retrieve current page URL - Add get_current_page_html() to get page HTML content - Add get_urls() to extract all links from page with domain filtering - Add set_viewport() to control browser viewport size - Add _save_context() to ensure persistent context saves properly - Update close() to call _save_context() before cleanup - Add __enter__/__exit__ for context manager support These methods ensure browser-agent has feature parity with cli/browser_agent for session persistence and utility functions. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Raw HTML is too noisy for agents. Better alternatives exist: - get_text() for visible content - analyze_page() for AI-powered analysis - analyze_html() for structured analysis Also removed from cli/browser_agent to keep both in sync.
- More descriptive name that clearly indicates it extracts links - Also fixes indentation error from previous commit - Renamed in both cli/browser_agent and browser-agent for sync
- Renamed tools/web_automation.py → tools/browser.py - Updated all imports across tests, agents, and examples - Matches connectonion's naming convention (browser.py) - All tests passing (3/3) This provides consistent naming across both projects: - connectonion: cli/browser_agent/browser.py - browser-agent: tools/browser.py
… module Renames class and all references across tests and examples so the import reads naturally: from tools.browser import Browser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
keyboard_type()method for reliable typing into any element type (contenteditable support)take_screenshot()with 1-second wait + verification guidance for full-page vs targeted screenshotsbrowser_config.pywith browser-use anti-detection settings (53 Chrome args + 30 disabled features)type_text()method (replaced by keyboard_type)Changes synced from connectonion/cli/browser_agent
Test Plan
🤖 Generated with Claude Code