Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maximize_window() fails with Chrome 133+ #2132

Open
rs517 opened this issue Feb 8, 2025 · 1 comment
Open

maximize_window() fails with Chrome 133+ #2132

rs517 opened this issue Feb 8, 2025 · 1 comment

Comments

@rs517
Copy link

rs517 commented Feb 8, 2025

maximize_window() fails with Chrome 133+ in undetected-chromedriver

Issue Description

When using undetected-chromedriver with Chrome version 133 or higher, the maximize_window() method fails with a JavaScript evaluation error. This issue does not occur with Chrome version 131 or lower.

Importantly, this issue is specific to undetected-chromedriver - the same code works perfectly fine with regular ChromeDriver:

# Works fine with regular ChromeDriver
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument('--start-maximized')

driver = webdriver.Chrome(
    options=options
)
driver.maximize_window()  # Works without any issues

# Fails with undetected-chromedriver
import undetected_chromedriver as uc

options = uc.ChromeOptions()
options.add_argument('--start-maximized')

driver = uc.Chrome(
    headless=False,
    use_subprocess=False,
    version_main=134,  # Issue occurs with version 133+
    options=options
)
driver.maximize_window()  # Triggers the error

Environment

  • undetected-chromedriver: 3.5.5
  • Chrome version: 134.0.6998.3
  • Python: 3.11
  • OS: Ubuntu 22.04 (Docker)

Steps to Reproduce

  1. Install undetected-chromedriver and set up Chrome 134
  2. Run the example code above
  3. The error occurs specifically with undetected-chromedriver, while regular ChromeDriver works normally

Error Message

selenium.common.exceptions.WebDriverException: Message: unknown error: JavaScript code failed
from unknown command: 'Runtime.evaluate' wasn't found
(Session info: chrome=134.0.6998.3)

Expected Behavior

  • The browser window should maximize without any errors
  • This functionality works correctly with:
    • Chrome version 131 in undetected-chromedriver
    • All Chrome versions in regular ChromeDriver

Additional Information

  • The issue is exclusive to undetected-chromedriver (regular ChromeDriver works fine with all versions)
  • The error occurs in both headless and non-headless modes
  • Adding --start-maximized to ChromeOptions does not prevent the issue

Current Workaround

Using Chrome version 131 as a temporary solution:

driver = uc.Chrome(
    version_main=131,  # Using older version as workaround
    options=options
)

Please let me know if you need any additional information to investigate this issue.

@nabe14
Copy link

nabe14 commented Feb 8, 2025

I feel that not only maximize_window(), but also many of the driver.~ commands are not working properly. I would like to ask the developers of uc to address this issue as soon as possible.

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

No branches or pull requests

2 participants