@orkestrel/browser 0.0.15 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -18
- package/dist/src/core/index.cjs +132 -101
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +463 -102
- package/dist/src/core/index.d.ts +463 -102
- package/dist/src/core/index.js +133 -102
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +93 -31
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +154 -56
- package/dist/src/server/index.d.ts +154 -56
- package/dist/src/server/index.js +93 -31
- package/dist/src/server/index.js.map +1 -1
- package/package.json +16 -17
package/README.md
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
# @orkestrel/browser
|
|
2
2
|
|
|
3
|
-
A
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
adapts it with a `WebSocketCDPTransport`, browser process launch/discovery
|
|
12
|
-
(`node:child_process` + `fetch`), a filesystem browser writer, and the
|
|
13
|
-
`Browser` façade that ties launch → context → page together. Part of the
|
|
3
|
+
> A lightweight Chrome DevTools Protocol automation layer for Chromium-family
|
|
4
|
+
> browsers: an environment-agnostic core that drives pages, frames, locators, and
|
|
5
|
+
> DOM snapshots over an injected transport, and a Node runtime that finds,
|
|
6
|
+
> launches, and connects to the browser itself.
|
|
7
|
+
|
|
8
|
+
Connect to a running browser or launch one with the `createBrowser` function, open a page in its
|
|
9
|
+
default context, and drive that page through locators, trusted input, network control, and DOM
|
|
10
|
+
snapshots. Inject your own `CDPTransportInterface` where the runtime is not Node. Part of the
|
|
14
11
|
`@orkestrel` line.
|
|
15
12
|
|
|
16
13
|
## Install
|
|
@@ -47,24 +44,23 @@ Drive the same protocol from any environment by injecting your own transport
|
|
|
47
44
|
over the environment-agnostic core:
|
|
48
45
|
|
|
49
46
|
```ts
|
|
50
|
-
import {
|
|
51
|
-
import type { CDPTransportInterface } from '@orkestrel/browser'
|
|
47
|
+
import { createCDPClient } from '@orkestrel/browser'
|
|
52
48
|
|
|
53
|
-
const
|
|
54
|
-
const client = new CDPClient({ transport })
|
|
49
|
+
const client = createCDPClient({ transport }) // transport: CDPTransportInterface
|
|
55
50
|
await client.connect()
|
|
56
51
|
const result = await client.send('Page.navigate', { url: 'https://example.com' })
|
|
52
|
+
await client.close()
|
|
57
53
|
```
|
|
58
54
|
|
|
59
55
|
## Guide
|
|
60
56
|
|
|
61
|
-
For the full surface — the CDP dispatch core, the `BrowserContext
|
|
62
|
-
`BrowserPage
|
|
57
|
+
For the full surface — the CDP dispatch core, the `BrowserContext`,
|
|
58
|
+
`BrowserPage`, and `BrowserCodegen` classes, the server transports, and usage
|
|
63
59
|
patterns — see [`guides/browser.md`](guides/browser.md).
|
|
64
60
|
|
|
65
61
|
## Package
|
|
66
62
|
|
|
67
|
-
Published with
|
|
63
|
+
Published with the entry points the `exports` field in `package.json` names:
|
|
68
64
|
the environment-agnostic core (`.`) — `CDPClient`, `BrowserContext`,
|
|
69
65
|
`BrowserPage`, `BrowserFrame`, DOM snapshot traversal helpers,
|
|
70
66
|
`BrowserCodegen`, `createCDPClient`, `CDPTransportInterface` —
|