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