camou 0.1.1 → 0.3.0
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/CHANGELOG.md +31 -0
- package/README.md +121 -4
- package/dist/api.d.ts +58 -0
- package/dist/api.js +138 -0
- package/dist/api.js.map +1 -0
- package/dist/browser/manager.d.ts +58 -1
- package/dist/browser/manager.js +134 -3
- package/dist/browser/manager.js.map +1 -1
- package/dist/camoufox/launcher.d.ts +10 -1
- package/dist/camoufox/launcher.js +34 -23
- package/dist/camoufox/launcher.js.map +1 -1
- package/dist/cli/main.d.ts +1 -1
- package/dist/cli/main.js +17 -7
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/output.js +80 -2
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/program.js +80 -3
- package/dist/cli/program.js.map +1 -1
- package/dist/daemon/router.js +22 -0
- package/dist/daemon/router.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/ipc/protocol.d.ts +671 -49
- package/dist/ipc/protocol.js +59 -1
- package/dist/ipc/protocol.js.map +1 -1
- package/package.json +12 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,37 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is loosely based on Keep a Changelog and uses semantic versioning.
|
|
6
6
|
|
|
7
|
+
## [0.3.0] - 2026-03-16
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Added Linux/macOS GitHub Actions CI for test, build, and package validation.
|
|
12
|
+
- Added compatibility-matrix workflows and local scripts for probing Camoufox vs `playwright-core` compatibility.
|
|
13
|
+
- Added broader browser automation commands including navigation, hover, type, check/uncheck, select, scroll, `get value`, and richer wait modes.
|
|
14
|
+
- Added higher-level Node API wrappers including `Camoufox`, `AsyncCamoufox`, and `resolveCamoufoxLaunchSpec()`.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Updated `README.md`, skill docs, and compatibility docs to reflect the first-class Node API and expanded command surface.
|
|
19
|
+
- Improved CI reliability by removing slow spawned `tsx` subprocesses from the CLI JSON tests.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- Fixed the macOS installer integration test to use platform-aware asset names and executable paths.
|
|
24
|
+
|
|
25
|
+
## [0.2.0] - 2026-03-15
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- Added a public Node API so `camou` can be used from scripts, not just the CLI.
|
|
30
|
+
- Added `launchCamoufox()`, `launchCamoufoxContext()`, and `withCamoufox()` for Playwright-based programmatic control.
|
|
31
|
+
- Exported browser management helpers from the package root for script usage.
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- Documented the new Node script workflow in `README.md`.
|
|
36
|
+
- Updated the `camou` skill to explain when to use the CLI vs the Node API and how to drive Camou from scripts.
|
|
37
|
+
|
|
7
38
|
## [0.1.1] - 2026-03-15
|
|
8
39
|
|
|
9
40
|
### Added
|
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Camou
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Camou is a local-first CLI and background daemon for driving [Camoufox](https://github.com/daijro/camoufox) through Playwright, without depending on the Camoufox Python SDK.
|
|
4
4
|
|
|
5
5
|
- npm package: `camou`
|
|
6
6
|
- installed command: `camou`
|
|
7
|
-
- project/repo name:
|
|
7
|
+
- project/repo name: camoucli
|
|
8
8
|
|
|
9
9
|
Camou is built for agent-style browser workflows:
|
|
10
10
|
|
|
@@ -14,6 +14,8 @@ Camou is built for agent-style browser workflows:
|
|
|
14
14
|
- interact through stable `@eN` refs from text snapshots
|
|
15
15
|
- install, switch, and diagnose Camoufox browser versions from the CLI
|
|
16
16
|
|
|
17
|
+
Camou takes strong inspiration from [vercel-labs/agent-browser](https://github.com/vercel-labs/agent-browser) and [BUNotesAI/agent-browser-session](https://github.com/BUNotesAI/agent-browser-session), but is built for the Camoufox + Playwright Firefox path and persistent local daemon workflows.
|
|
18
|
+
|
|
17
19
|
## Why Camou
|
|
18
20
|
|
|
19
21
|
| Feature | Why it matters |
|
|
@@ -60,6 +62,28 @@ Notes:
|
|
|
60
62
|
- `camou install` runs a quick headless launch probe after download.
|
|
61
63
|
- `camou use <version>` runs the same compatibility check when you switch versions.
|
|
62
64
|
|
|
65
|
+
## Install The Skill
|
|
66
|
+
|
|
67
|
+
Camou also ships an agent skill that can be installed through the open skills ecosystem at [skills.sh](https://skills.sh).
|
|
68
|
+
|
|
69
|
+
Install it from this repo:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npx skills add txchen/camoucli --skill camou
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Useful variants:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Preview available skills in the repo
|
|
79
|
+
npx skills add txchen/camoucli --list
|
|
80
|
+
|
|
81
|
+
# Install globally for a specific agent
|
|
82
|
+
npx skills add txchen/camoucli --skill camou -g -a opencode
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The skill teaches agents the recommended Camou workflow: `open -> snapshot -i -> interact with @refs -> re-snapshot`, plus session/tab/version troubleshooting guidance.
|
|
86
|
+
|
|
63
87
|
## Quick Start
|
|
64
88
|
|
|
65
89
|
```bash
|
|
@@ -82,6 +106,58 @@ Important ref rule:
|
|
|
82
106
|
|
|
83
107
|
- Re-run `snapshot` after navigation or major page changes. Refs are per tab and are invalidated on navigation or a new snapshot.
|
|
84
108
|
|
|
109
|
+
## Use From Node Scripts
|
|
110
|
+
|
|
111
|
+
Camou can also be used as a Node library, not just a CLI.
|
|
112
|
+
|
|
113
|
+
The programmatic API is Playwright-based: it launches Camoufox for you and gives you a real Playwright `BrowserContext`, similar in spirit to the Camoufox Python wrapper.
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
import { Camoufox } from 'camou';
|
|
117
|
+
|
|
118
|
+
const camou = await Camoufox.launch({
|
|
119
|
+
session: 'script',
|
|
120
|
+
headless: false,
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
const page = await camou.open('https://example.com');
|
|
124
|
+
console.log(await page.title());
|
|
125
|
+
|
|
126
|
+
await camou.close();
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
If you prefer a scoped helper:
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
import { Camoufox } from 'camou';
|
|
133
|
+
|
|
134
|
+
await Camoufox.with({ session: 'script' }, async (camou) => {
|
|
135
|
+
const page = await camou.open('https://example.com');
|
|
136
|
+
console.log(await page.title());
|
|
137
|
+
});
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Useful exported helpers include:
|
|
141
|
+
|
|
142
|
+
- `Camoufox.launch()`
|
|
143
|
+
- `Camoufox.launchContext()`
|
|
144
|
+
- `Camoufox.with()`
|
|
145
|
+
- `AsyncCamoufox`
|
|
146
|
+
- `launchCamoufox()`
|
|
147
|
+
- `launchCamoufoxContext()`
|
|
148
|
+
- `resolveCamoufoxLaunchSpec()`
|
|
149
|
+
- `withCamoufox()`
|
|
150
|
+
- `installCamoufox()`
|
|
151
|
+
- `listInstalledBrowsers()`
|
|
152
|
+
- `setCurrentBrowser()`
|
|
153
|
+
- `doctorCamoufox()`
|
|
154
|
+
|
|
155
|
+
Notes:
|
|
156
|
+
|
|
157
|
+
- install a browser first with `camou install` or `installCamoufox()`
|
|
158
|
+
- use a dedicated `session` name in scripts if you do not want to share the default CLI profile
|
|
159
|
+
- the returned context is a normal Playwright context, so you can use standard Playwright APIs from there
|
|
160
|
+
|
|
85
161
|
## Recommended Agent Workflow
|
|
86
162
|
|
|
87
163
|
For agents and automation loops, this is the happy path:
|
|
@@ -217,15 +293,26 @@ camou doctor
|
|
|
217
293
|
|
|
218
294
|
```bash
|
|
219
295
|
camou open <url>
|
|
296
|
+
camou back
|
|
297
|
+
camou forward
|
|
298
|
+
camou reload
|
|
220
299
|
camou snapshot [-i]
|
|
221
300
|
camou click <selectorOrRef>
|
|
301
|
+
camou hover <selectorOrRef>
|
|
222
302
|
camou fill <selectorOrRef> <text>
|
|
303
|
+
camou type <selectorOrRef> <text>
|
|
304
|
+
camou check <selectorOrRef>
|
|
305
|
+
camou uncheck <selectorOrRef>
|
|
306
|
+
camou select <selectorOrRef> <value>
|
|
223
307
|
camou press <key>
|
|
224
|
-
camou
|
|
308
|
+
camou scroll <direction> [amount]
|
|
309
|
+
camou scrollintoview <selectorOrRef>
|
|
310
|
+
camou wait [selectorOrRef] [--text <text>] [--load <state>]
|
|
225
311
|
camou screenshot [path]
|
|
226
312
|
camou get url
|
|
227
313
|
camou get title
|
|
228
314
|
camou get text <selectorOrRef>
|
|
315
|
+
camou get value <selectorOrRef>
|
|
229
316
|
```
|
|
230
317
|
|
|
231
318
|
### Sessions and tabs
|
|
@@ -259,6 +346,11 @@ Most browser commands support:
|
|
|
259
346
|
- `--json`
|
|
260
347
|
- `--verbose`
|
|
261
348
|
|
|
349
|
+
`wait` also supports:
|
|
350
|
+
|
|
351
|
+
- `--text <text>`
|
|
352
|
+
- `--load <domcontentloaded|load|networkidle>`
|
|
353
|
+
|
|
262
354
|
## Presets
|
|
263
355
|
|
|
264
356
|
Built-in presets give you a small layer of tested ergonomics on top of raw config and prefs JSON.
|
|
@@ -323,6 +415,14 @@ Current local verification with `playwright-core` `1.51.1`:
|
|
|
323
415
|
| `135.0.1-beta.24` | launches | smoke-tested successfully |
|
|
324
416
|
| `135.0.1-beta.23` | incompatible | `Browser.setContrast` is not supported |
|
|
325
417
|
|
|
418
|
+
The repo now also includes:
|
|
419
|
+
|
|
420
|
+
- Linux/macOS CI in `.github/workflows/ci.yml`
|
|
421
|
+
- a workflow-driven compatibility probe in `.github/workflows/compatibility-matrix.yml`
|
|
422
|
+
- local scripts to generate compatibility reports and markdown summaries
|
|
423
|
+
|
|
424
|
+
See `docs/compatibility-matrix.md` for the workflow and local tooling.
|
|
425
|
+
|
|
326
426
|
## Storage Layout
|
|
327
427
|
|
|
328
428
|
Camou keeps its own runtime state and profiles, but stores browser binaries in the shared Camoufox cache layout when possible.
|
|
@@ -356,3 +456,20 @@ Local development commands:
|
|
|
356
456
|
npm run dev -- --help
|
|
357
457
|
npm run dev:daemon
|
|
358
458
|
```
|
|
459
|
+
|
|
460
|
+
Compatibility tooling:
|
|
461
|
+
|
|
462
|
+
```bash
|
|
463
|
+
# produce a raw compatibility report JSON
|
|
464
|
+
node scripts/run-compatibility-report.mjs --output compatibility-report.json
|
|
465
|
+
|
|
466
|
+
# turn one or more reports into a markdown table
|
|
467
|
+
node scripts/generate-compatibility-matrix.mjs compatibility-report.json
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
## Acknowledgements
|
|
471
|
+
|
|
472
|
+
Camou learned a lot from these projects:
|
|
473
|
+
|
|
474
|
+
- [vercel-labs/agent-browser](https://github.com/vercel-labs/agent-browser) for the agent-oriented command workflow and skill ecosystem patterns
|
|
475
|
+
- [BUNotesAI/agent-browser-session](https://github.com/BUNotesAI/agent-browser-session) for persistent-session and named-tab ergonomics
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { BrowserContext, Page } from 'playwright-core';
|
|
2
|
+
import type { LaunchInput, ResolvedLaunchConfig } from './camoufox/config.js';
|
|
3
|
+
import { type PreparedPersistentCamoufoxLaunch } from './camoufox/launcher.js';
|
|
4
|
+
import { type CamoucliPaths } from './state/paths.js';
|
|
5
|
+
export interface LaunchCamoufoxOptions extends LaunchInput {
|
|
6
|
+
session?: string | undefined;
|
|
7
|
+
paths?: CamoucliPaths | undefined;
|
|
8
|
+
verbose?: boolean | undefined;
|
|
9
|
+
}
|
|
10
|
+
export interface ResolvedCamoufoxLaunchSpec {
|
|
11
|
+
sessionName: string;
|
|
12
|
+
browserVersion: string;
|
|
13
|
+
executablePath: string;
|
|
14
|
+
profileDir: string;
|
|
15
|
+
downloadsDir: string;
|
|
16
|
+
artifactsDir: string;
|
|
17
|
+
resolvedConfig: ResolvedLaunchConfig;
|
|
18
|
+
userDataDir: string;
|
|
19
|
+
launchOptions: PreparedPersistentCamoufoxLaunch['launchOptions'];
|
|
20
|
+
}
|
|
21
|
+
export declare class CamoufoxSession {
|
|
22
|
+
readonly context: BrowserContext;
|
|
23
|
+
readonly sessionName: string;
|
|
24
|
+
readonly browserVersion: string;
|
|
25
|
+
readonly executablePath: string;
|
|
26
|
+
readonly profileDir: string;
|
|
27
|
+
readonly downloadsDir: string;
|
|
28
|
+
readonly artifactsDir: string;
|
|
29
|
+
readonly resolvedConfig: ResolvedLaunchConfig;
|
|
30
|
+
constructor(input: {
|
|
31
|
+
context: BrowserContext;
|
|
32
|
+
sessionName: string;
|
|
33
|
+
browserVersion: string;
|
|
34
|
+
executablePath: string;
|
|
35
|
+
profileDir: string;
|
|
36
|
+
downloadsDir: string;
|
|
37
|
+
artifactsDir: string;
|
|
38
|
+
resolvedConfig: ResolvedLaunchConfig;
|
|
39
|
+
});
|
|
40
|
+
newPage(url?: string): Promise<Page>;
|
|
41
|
+
pages(): Page[];
|
|
42
|
+
firstPage(): Page | undefined;
|
|
43
|
+
ensurePage(): Promise<Page>;
|
|
44
|
+
open(url: string, page?: Page): Promise<Page>;
|
|
45
|
+
close(): Promise<void>;
|
|
46
|
+
}
|
|
47
|
+
export declare class Camoufox extends CamoufoxSession {
|
|
48
|
+
static launch(options?: LaunchCamoufoxOptions): Promise<Camoufox>;
|
|
49
|
+
static launchContext(options?: LaunchCamoufoxOptions): Promise<BrowserContext>;
|
|
50
|
+
static resolveLaunch(options?: LaunchCamoufoxOptions): Promise<ResolvedCamoufoxLaunchSpec>;
|
|
51
|
+
static with<T>(options: LaunchCamoufoxOptions, callback: (browser: Camoufox) => Promise<T> | T): Promise<T>;
|
|
52
|
+
}
|
|
53
|
+
export declare class AsyncCamoufox extends Camoufox {
|
|
54
|
+
}
|
|
55
|
+
export declare function launchCamoufox(options?: LaunchCamoufoxOptions): Promise<CamoufoxSession>;
|
|
56
|
+
export declare function resolveCamoufoxLaunchSpec(options?: LaunchCamoufoxOptions): Promise<ResolvedCamoufoxLaunchSpec>;
|
|
57
|
+
export declare function launchCamoufoxContext(options?: LaunchCamoufoxOptions): Promise<BrowserContext>;
|
|
58
|
+
export declare function withCamoufox<T>(options: LaunchCamoufoxOptions, callback: (session: CamoufoxSession) => Promise<T> | T): Promise<T>;
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { launchPersistentCamoufox, preparePersistentCamoufoxLaunch } from './camoufox/launcher.js';
|
|
2
|
+
import { ensureBasePaths, getCamoucliPaths } from './state/paths.js';
|
|
3
|
+
import { Logger } from './util/log.js';
|
|
4
|
+
export class CamoufoxSession {
|
|
5
|
+
context;
|
|
6
|
+
sessionName;
|
|
7
|
+
browserVersion;
|
|
8
|
+
executablePath;
|
|
9
|
+
profileDir;
|
|
10
|
+
downloadsDir;
|
|
11
|
+
artifactsDir;
|
|
12
|
+
resolvedConfig;
|
|
13
|
+
constructor(input) {
|
|
14
|
+
this.context = input.context;
|
|
15
|
+
this.sessionName = input.sessionName;
|
|
16
|
+
this.browserVersion = input.browserVersion;
|
|
17
|
+
this.executablePath = input.executablePath;
|
|
18
|
+
this.profileDir = input.profileDir;
|
|
19
|
+
this.downloadsDir = input.downloadsDir;
|
|
20
|
+
this.artifactsDir = input.artifactsDir;
|
|
21
|
+
this.resolvedConfig = input.resolvedConfig;
|
|
22
|
+
}
|
|
23
|
+
async newPage(url) {
|
|
24
|
+
const page = await this.context.newPage();
|
|
25
|
+
if (url) {
|
|
26
|
+
await page.goto(url, { waitUntil: 'domcontentloaded' });
|
|
27
|
+
}
|
|
28
|
+
return page;
|
|
29
|
+
}
|
|
30
|
+
pages() {
|
|
31
|
+
return this.context.pages();
|
|
32
|
+
}
|
|
33
|
+
firstPage() {
|
|
34
|
+
return this.pages()[0];
|
|
35
|
+
}
|
|
36
|
+
async ensurePage() {
|
|
37
|
+
return this.firstPage() ?? this.context.newPage();
|
|
38
|
+
}
|
|
39
|
+
async open(url, page) {
|
|
40
|
+
const targetPage = page ?? await this.ensurePage();
|
|
41
|
+
await targetPage.goto(url, { waitUntil: 'domcontentloaded' });
|
|
42
|
+
return targetPage;
|
|
43
|
+
}
|
|
44
|
+
async close() {
|
|
45
|
+
await this.context.close();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export class Camoufox extends CamoufoxSession {
|
|
49
|
+
static async launch(options = {}) {
|
|
50
|
+
const session = await launchCamoufox(options);
|
|
51
|
+
return new Camoufox({
|
|
52
|
+
context: session.context,
|
|
53
|
+
sessionName: session.sessionName,
|
|
54
|
+
browserVersion: session.browserVersion,
|
|
55
|
+
executablePath: session.executablePath,
|
|
56
|
+
profileDir: session.profileDir,
|
|
57
|
+
downloadsDir: session.downloadsDir,
|
|
58
|
+
artifactsDir: session.artifactsDir,
|
|
59
|
+
resolvedConfig: session.resolvedConfig,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
static async launchContext(options = {}) {
|
|
63
|
+
return launchCamoufoxContext(options);
|
|
64
|
+
}
|
|
65
|
+
static async resolveLaunch(options = {}) {
|
|
66
|
+
return resolveCamoufoxLaunchSpec(options);
|
|
67
|
+
}
|
|
68
|
+
static async with(options, callback) {
|
|
69
|
+
const browser = await Camoufox.launch(options);
|
|
70
|
+
try {
|
|
71
|
+
return await callback(browser);
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
await browser.close();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export class AsyncCamoufox extends Camoufox {
|
|
79
|
+
}
|
|
80
|
+
function createApiLogger(verbose = false) {
|
|
81
|
+
if (!verbose) {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
return new Logger({
|
|
85
|
+
name: 'api',
|
|
86
|
+
verbose: true,
|
|
87
|
+
mirrorToStderr: true,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
export async function launchCamoufox(options = {}) {
|
|
91
|
+
const sessionName = options.session ?? 'default';
|
|
92
|
+
const paths = options.paths ?? getCamoucliPaths();
|
|
93
|
+
await ensureBasePaths(paths);
|
|
94
|
+
const logger = createApiLogger(options.verbose);
|
|
95
|
+
const launched = await launchPersistentCamoufox(paths, sessionName, options, logger);
|
|
96
|
+
return new CamoufoxSession({
|
|
97
|
+
context: launched.context,
|
|
98
|
+
sessionName,
|
|
99
|
+
browserVersion: launched.browserVersion,
|
|
100
|
+
executablePath: launched.installPath,
|
|
101
|
+
profileDir: launched.sessionPaths.profileDir,
|
|
102
|
+
downloadsDir: launched.sessionPaths.downloadsDir,
|
|
103
|
+
artifactsDir: launched.sessionPaths.artifactsDir,
|
|
104
|
+
resolvedConfig: launched.resolvedConfig,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
export async function resolveCamoufoxLaunchSpec(options = {}) {
|
|
108
|
+
const sessionName = options.session ?? 'default';
|
|
109
|
+
const paths = options.paths ?? getCamoucliPaths();
|
|
110
|
+
await ensureBasePaths(paths);
|
|
111
|
+
const logger = createApiLogger(options.verbose);
|
|
112
|
+
const prepared = await preparePersistentCamoufoxLaunch(paths, sessionName, options, logger);
|
|
113
|
+
return {
|
|
114
|
+
sessionName,
|
|
115
|
+
browserVersion: prepared.browserVersion,
|
|
116
|
+
executablePath: prepared.installPath,
|
|
117
|
+
profileDir: prepared.sessionPaths.profileDir,
|
|
118
|
+
downloadsDir: prepared.sessionPaths.downloadsDir,
|
|
119
|
+
artifactsDir: prepared.sessionPaths.artifactsDir,
|
|
120
|
+
resolvedConfig: prepared.resolvedConfig,
|
|
121
|
+
userDataDir: prepared.userDataDir,
|
|
122
|
+
launchOptions: prepared.launchOptions,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
export async function launchCamoufoxContext(options = {}) {
|
|
126
|
+
const session = await launchCamoufox(options);
|
|
127
|
+
return session.context;
|
|
128
|
+
}
|
|
129
|
+
export async function withCamoufox(options, callback) {
|
|
130
|
+
const session = await launchCamoufox(options);
|
|
131
|
+
try {
|
|
132
|
+
return await callback(session);
|
|
133
|
+
}
|
|
134
|
+
finally {
|
|
135
|
+
await session.close();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=api.js.map
|
package/dist/api.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,+BAA+B,EAAyC,MAAM,wBAAwB,CAAC;AAC1I,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAsB,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAoBvC,MAAM,OAAO,eAAe;IACjB,OAAO,CAAiB;IACxB,WAAW,CAAS;IACpB,cAAc,CAAS;IACvB,cAAc,CAAS;IACvB,UAAU,CAAS;IACnB,YAAY,CAAS;IACrB,YAAY,CAAS;IACrB,cAAc,CAAuB;IAE9C,YAAY,KASX;QACC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QACrC,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;QAC3C,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;QAC3C,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QACvC,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,GAAY;QACxB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OA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BAAqB,CAAC,UAAiC,EAAE;IAC7E,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;IAC9C,OAAO,OAAO,CAAC,OAAO,CAAC;AACzB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAA8B,EAC9B,QAAsD;IAEtD,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;IAE9C,IAAI,CAAC;QACH,OAAO,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;AACH,CAAC"}
|
|
@@ -22,6 +22,18 @@ export declare class BrowserManager {
|
|
|
22
22
|
tabName: string;
|
|
23
23
|
url: string;
|
|
24
24
|
}): Promise<Record<string, unknown>>;
|
|
25
|
+
back(input: LaunchInput & {
|
|
26
|
+
session: string;
|
|
27
|
+
tabName: string;
|
|
28
|
+
}): Promise<Record<string, unknown>>;
|
|
29
|
+
forward(input: LaunchInput & {
|
|
30
|
+
session: string;
|
|
31
|
+
tabName: string;
|
|
32
|
+
}): Promise<Record<string, unknown>>;
|
|
33
|
+
reload(input: LaunchInput & {
|
|
34
|
+
session: string;
|
|
35
|
+
tabName: string;
|
|
36
|
+
}): Promise<Record<string, unknown>>;
|
|
25
37
|
snapshot(input: LaunchInput & {
|
|
26
38
|
session: string;
|
|
27
39
|
tabName: string;
|
|
@@ -32,17 +44,55 @@ export declare class BrowserManager {
|
|
|
32
44
|
tabName: string;
|
|
33
45
|
target: string;
|
|
34
46
|
}): Promise<Record<string, unknown>>;
|
|
47
|
+
hover(input: LaunchInput & {
|
|
48
|
+
session: string;
|
|
49
|
+
tabName: string;
|
|
50
|
+
target: string;
|
|
51
|
+
}): Promise<Record<string, unknown>>;
|
|
35
52
|
fill(input: LaunchInput & {
|
|
36
53
|
session: string;
|
|
37
54
|
tabName: string;
|
|
38
55
|
target: string;
|
|
39
56
|
text: string;
|
|
40
57
|
}): Promise<Record<string, unknown>>;
|
|
58
|
+
type(input: LaunchInput & {
|
|
59
|
+
session: string;
|
|
60
|
+
tabName: string;
|
|
61
|
+
target: string;
|
|
62
|
+
text: string;
|
|
63
|
+
}): Promise<Record<string, unknown>>;
|
|
64
|
+
check(input: LaunchInput & {
|
|
65
|
+
session: string;
|
|
66
|
+
tabName: string;
|
|
67
|
+
target: string;
|
|
68
|
+
}): Promise<Record<string, unknown>>;
|
|
69
|
+
uncheck(input: LaunchInput & {
|
|
70
|
+
session: string;
|
|
71
|
+
tabName: string;
|
|
72
|
+
target: string;
|
|
73
|
+
}): Promise<Record<string, unknown>>;
|
|
74
|
+
select(input: LaunchInput & {
|
|
75
|
+
session: string;
|
|
76
|
+
tabName: string;
|
|
77
|
+
target: string;
|
|
78
|
+
value: string;
|
|
79
|
+
}): Promise<Record<string, unknown>>;
|
|
41
80
|
press(input: LaunchInput & {
|
|
42
81
|
session: string;
|
|
43
82
|
tabName: string;
|
|
44
83
|
key: string;
|
|
45
84
|
}): Promise<Record<string, unknown>>;
|
|
85
|
+
scroll(input: LaunchInput & {
|
|
86
|
+
session: string;
|
|
87
|
+
tabName: string;
|
|
88
|
+
direction: 'up' | 'down' | 'left' | 'right';
|
|
89
|
+
amount?: number | undefined;
|
|
90
|
+
}): Promise<Record<string, unknown>>;
|
|
91
|
+
scrollIntoView(input: LaunchInput & {
|
|
92
|
+
session: string;
|
|
93
|
+
tabName: string;
|
|
94
|
+
target: string;
|
|
95
|
+
}): Promise<Record<string, unknown>>;
|
|
46
96
|
screenshot(input: LaunchInput & {
|
|
47
97
|
session: string;
|
|
48
98
|
tabName: string;
|
|
@@ -61,10 +111,17 @@ export declare class BrowserManager {
|
|
|
61
111
|
tabName: string;
|
|
62
112
|
target: string;
|
|
63
113
|
}): Promise<Record<string, unknown>>;
|
|
64
|
-
|
|
114
|
+
getValue(input: LaunchInput & {
|
|
65
115
|
session: string;
|
|
66
116
|
tabName: string;
|
|
67
117
|
target: string;
|
|
118
|
+
}): Promise<Record<string, unknown>>;
|
|
119
|
+
wait(input: LaunchInput & {
|
|
120
|
+
session: string;
|
|
121
|
+
tabName: string;
|
|
122
|
+
target?: string | undefined;
|
|
123
|
+
text?: string | undefined;
|
|
124
|
+
loadState?: 'domcontentloaded' | 'load' | 'networkidle' | undefined;
|
|
68
125
|
timeoutMs?: number | undefined;
|
|
69
126
|
}): Promise<Record<string, unknown>>;
|
|
70
127
|
listTabs(sessionName: string): Promise<Array<Record<string, unknown>>>;
|