Add browser resolution support (width/height parameters) #56
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.
Add Browser Resolution Support (Width/Height Parameters)
🎯 Summary
Adds the ability to launch browsers with custom window dimensions via
widthandheightparameters across all client APIs (Python, JavaScript, and MCP).💡 Motivation
Users often need to test their applications at specific resolutions or take screenshots at precise dimensions. Currently, Vibium always launches browsers at the default size, making it difficult to:
✨ Changes
Go Clicker Binary
WidthandHeightfields toLaunchOptionsstruct--window-size=WIDTH,HEIGHTargument to Chrome--widthand--heightCLI flags toservecommandPython Client
widthandheightparameters tobrowser.launch()(async)widthandheightparameters tobrowser_sync.launch()(sync)ClickerProcess.start()to pass flags to clicker binaryJavaScript/TypeScript Client
LaunchOptionsinterface withwidth?andheight?browser.launch()APIbrowserSync.launch()APIClickerProcessto pass flags to clicker serveDocumentation & Examples
📝 Usage Examples
Python:
JavaScript:
MCP (for AI agents):
{ "tool": "browser_launch", "arguments": { "width": 1920, "height": 1080 } }✅ Testing
Added comprehensive test suite covering:
All tests passing: 11/11 ✅
🔄 Backward Compatibility
Fully backward compatible - all parameters are optional with sensible defaults:
📊 Files Changed
🧪 Verification
Integration tests (requires Chrome):
📸 Screenshot Evidence
Screenshots captured at different resolutions show correct viewport sizing:
🎨 Implementation Details
--window-sizeargument directlyclicker serve --width X --height Y→ Router → Browser launcher → Chrome📋 Checklist
🤝 Reviewer Notes
This is a straightforward feature addition that enhances Vibium's flexibility without changing existing behavior. The implementation is consistent across all language clients and maintains the project's simple API design.