aboutsummaryrefslogtreecommitdiff
path: root/src/cdp/attach.ts
diff options
context:
space:
mode:
authoramankumarsingh77 <amankumarsingh7702@gmail.com>2026-07-28 22:01:47 +0530
committerAman Kumar <145339995+amankumarsingh77@users.noreply.github.com>2026-08-02 19:12:46 +0530
commitc88082515dcd9c0df1328b85420e97d7286ad428 (patch)
treed3a45084e5bea7473d6b6bcbe5163165c4368f64 /src/cdp/attach.ts
parent86045450c208bc51670dd9554e581f2a62b181c9 (diff)
refactor: attach and windowId become session methods
cdp/attach.ts and cdp/window.ts were a module each for a single `map(await session.callBrowser(...))` one-liner that took the session as its first argument — two files, two imports and two names for what the session can expose itself. They are now session.attach(targetId) and session.windowId(targetId). session.ts also repeated `targetId ? tabs.get(targetId) : undefined` eight times; that is now currentTab(). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'src/cdp/attach.ts')
-rw-r--r--src/cdp/attach.ts12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/cdp/attach.ts b/src/cdp/attach.ts
deleted file mode 100644
index c1b101b..0000000
--- a/src/cdp/attach.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { map, type Result } from "../util/result";
-import type { CdpError } from "./errors";
-import type { CdpSession } from "./session";
-
-export const attachTo = async (
- session: CdpSession,
- targetId: string,
-): Promise<Result<string, CdpError>> =>
- map(
- await session.callBrowser("Target.attachToTarget", { targetId, flatten: true }),
- (d) => d.sessionId,
- );