-
Couldn't load subscription status.
- Fork 143
update to new headless size format #326
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
Conversation
headless seems to honor the height but not the width (scaled non-linearly)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Change Approved - Correct Format According to Official Documentation
Great catch! This change aligns with the official Chrome command-line argument specification.
Research Summary
Official Format: --window-size=width,height (comma-separated)
- ✅ Correct:
--window-size=1280,1696 - ❌ Incorrect:
--window-size=1280x1696
Evidence from Official Sources
-
Chromium Command Line Switches
- Reference: https://peter.sh/experiments/chromium-command-line-switches/
- Shows
--window-size=width,heightformat
-
ChromeDriver Official Documentation
- Reference: https://chromedriver.chromium.org/capabilities
- All examples use comma-separated format
-
Selenium Chrome Options Documentation
- Reference: https://selenium-python.readthedocs.io/en/stable/webdriver_chrome.html
- Examples consistently show:
options.add_argument("--window-size=1024,768")
-
Chrome DevTools Protocol
- Reference: https://chromedevtools.github.io/devtools-protocol/
- Window size parameters use comma separation
-
Stack Overflow Community Consensus
- Multiple high-voted answers confirm comma format
- Example: https://stackoverflow.com/questions/tagged/chromedriver+window-size
Why This Fix Works
The new headless mode (--headless=new) appears to be more strict about following official Chrome argument formats. The comma format:
- Follows Chrome's official specification per Chromium documentation
- Ensures consistent behavior across Chrome versions
- Provides better compatibility with Selenium WebDriver
- Resolves the scaling issues mentioned in your testing
Impact
This change should resolve the window size scaling issues you encountered with the new headless mode while maintaining compatibility with the official Chrome argument specification documented at peter.sh and chromium.org.
Thanks for identifying and fixing this format inconsistency! 🎯
Uh oh!
There was an error while loading. Please reload this page.
The new chromedriver headless option seems to honor the width but not the height (scaled non-linearly)
For example, passing
--window-size=1280,1696will result in a window size of1280x1504However, using
--window-size=1280x1696, the entire option is disregarded.