support cdp for task and workflow (#3244)

This commit is contained in:
LawyZheng
2025-08-21 11:16:22 +08:00
committed by GitHub
parent d0296f0e25
commit c0a31fe0a6
17 changed files with 194 additions and 51 deletions

View File

@@ -33,6 +33,7 @@ class BrowserManager:
script_id: str | None = None,
organization_id: str | None = None,
extra_http_headers: dict[str, str] | None = None,
browser_address: str | None = None,
) -> BrowserState:
pw = await async_playwright().start()
(
@@ -48,6 +49,7 @@ class BrowserManager:
script_id=script_id,
organization_id=organization_id,
extra_http_headers=extra_http_headers,
browser_address=browser_address,
)
return BrowserState(
pw=pw,
@@ -113,6 +115,7 @@ class BrowserManager:
task_id=task.task_id,
organization_id=task.organization_id,
extra_http_headers=task.extra_http_headers,
browser_address=task.browser_address,
)
if browser_session_id:
@@ -133,6 +136,7 @@ class BrowserManager:
task_id=task.task_id,
organization_id=task.organization_id,
extra_http_headers=task.extra_http_headers,
browser_address=task.browser_address,
)
return browser_state
@@ -187,6 +191,7 @@ class BrowserManager:
workflow_run_id=workflow_run.workflow_run_id,
organization_id=workflow_run.organization_id,
extra_http_headers=workflow_run.extra_http_headers,
browser_address=workflow_run.browser_address,
)
if browser_session_id:
@@ -207,6 +212,7 @@ class BrowserManager:
workflow_run_id=workflow_run.workflow_run_id,
organization_id=workflow_run.organization_id,
extra_http_headers=workflow_run.extra_http_headers,
browser_address=workflow_run.browser_address,
)
return browser_state