This commit is contained in:
@@ -28,11 +28,16 @@ async def safe_browser_operation(url, operation_func):
|
||||
), timeout=30.0)
|
||||
|
||||
# Create context and page with timeout
|
||||
context = await asyncio.wait_for(browser.new_context(
|
||||
user_agent=CUSTOM_USER_AGENT,
|
||||
viewport={'width': 1920, 'height': 1080},
|
||||
ignore_https_errors=True,
|
||||
), timeout=10.0)
|
||||
context = await asyncio.wait_for(
|
||||
browser.new_context(
|
||||
user_agent=CUSTOM_USER_AGENT,
|
||||
# Default viewport used across endpoints unless overridden per-page.
|
||||
# Keeping this stable ensures coordinate-based interactions match screenshots.
|
||||
viewport={"width": 1280, "height": 720},
|
||||
ignore_https_errors=True,
|
||||
),
|
||||
timeout=10.0,
|
||||
)
|
||||
|
||||
page = await asyncio.wait_for(context.new_page(), timeout=10.0)
|
||||
page.set_default_timeout(30000) # 30 second timeout
|
||||
|
||||
Reference in New Issue
Block a user