Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

when no_viewport is True then browser window size determines the viewport

Anirudha6191fa90996c481
diff --git a/browser_use/browser/browser.py b/browser_use/browser/browser.py
index 51786b311..6a9e9d9fa 100644
--- a/browser_use/browser/browser.py
+++ b/browser_use/browser/browser.py
@@ -271,6 +271,7 @@ class Browser:
and hasattr(self.config, 'new_context_config')
and hasattr(self.config.new_context_config, 'window_width')
and hasattr(self.config.new_context_config, 'window_height')
+ and not self.config.new_context_config.no_viewport
):
screen_size = {
'width': self.config.new_context_config.window_width,