mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 04:57:40 +00:00
feat(browser): use persistent Playwright connections for remote profile tab operations
For remote CDP profiles (e.g., Browserless), tab operations now use Playwright's persistent connection instead of stateless HTTP requests. This ensures tabs persist across operations rather than being terminated after each request. Changes: - pw-session.ts: Add listPagesViaPlaywright, createPageViaPlaywright, and closePageByTargetIdViaPlaywright functions using the cached Playwright connection - pw-ai.ts: Export new functions for dynamic import - server-context.ts: For remote profiles (!cdpIsLoopback), use Playwright-based tab operations; local profiles continue using HTTP endpoints - server-context.ts: Fix ensureTabAvailable to not require wsUrl for remote profiles since Playwright accesses pages directly This is a follow-up to #895 which added authentication support for remote CDP profiles. The original PR description mentioned switching to persistent Playwright connections for tab operations, but only the auth changes were merged.
This commit is contained in:
committed by
Peter Steinberger
parent
bcfc9bead5
commit
02a4de0029
@@ -1,8 +1,11 @@
|
||||
export {
|
||||
type BrowserConsoleMessage,
|
||||
closePageByTargetIdViaPlaywright,
|
||||
closePlaywrightBrowserConnection,
|
||||
createPageViaPlaywright,
|
||||
ensurePageState,
|
||||
getPageForTargetId,
|
||||
listPagesViaPlaywright,
|
||||
refLocator,
|
||||
type WithSnapshotForAI,
|
||||
} from "./pw-session.js";
|
||||
|
||||
Reference in New Issue
Block a user