Skip to content

Comments

Fix --no-headless flag not showing browser window#2

Open
keithschacht wants to merge 1 commit intoparruda:mainfrom
keithschacht:fix-headless-browser-visibility
Open

Fix --no-headless flag not showing browser window#2
keithschacht wants to merge 1 commit intoparruda:mainfrom
keithschacht:fix-headless-browser-visibility

Conversation

@keithschacht
Copy link

@keithschacht keithschacht commented Jul 31, 2025

Summary

  • Fixed issue where --no-headless flag wasn't working - browser window remained hidden
  • SessionManager was hardcoded to use :selenium_chrome_headless driver regardless of the headless parameter

The Fix

  1. Added a register_driver method that dynamically configures the Chrome driver based on the @headless instance variable
  2. Changed create_session to use the configurable :selenium_chrome driver instead of the hardcoded :selenium_chrome_headless
  3. The driver registration now conditionally adds --headless argument only when @headless is true

This fix ensures developers can visually debug browser automation when needed by using the --no-headless flag.

@keithschacht keithschacht force-pushed the fix-headless-browser-visibility branch from e32ea21 to 5ef7c10 Compare July 31, 2025 19:12
The --no-headless flag was being passed correctly but SessionManager was
hardcoded to always use :selenium_chrome_headless driver. This fix:

- Adds register_driver method that respects the @Headless parameter
- Changes from hardcoded headless driver to configurable :selenium_chrome
- Only adds --headless argument to Chrome options when @Headless is true

This allows the browser window to be visible when using --no-headless flag.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@keithschacht keithschacht force-pushed the fix-headless-browser-visibility branch from 8823d5a to e52dec9 Compare July 31, 2025 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant