browser-pilot 0.0.14 → 0.0.16
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 +89 -667
- package/dist/actions.cjs +1073 -41
- package/dist/actions.d.cts +11 -3
- package/dist/actions.d.ts +11 -3
- package/dist/actions.mjs +1 -1
- package/dist/browser-ZCR6AA4D.mjs +11 -0
- package/dist/browser.cjs +1431 -62
- package/dist/browser.d.cts +4 -4
- package/dist/browser.d.ts +4 -4
- package/dist/browser.mjs +4 -4
- package/dist/cdp.cjs +5 -1
- package/dist/cdp.d.cts +1 -1
- package/dist/cdp.d.ts +1 -1
- package/dist/cdp.mjs +1 -1
- package/dist/{chunk-7NDR6V7S.mjs → chunk-6GBYX7C2.mjs} +1405 -528
- package/dist/{chunk-KIFB526Y.mjs → chunk-BVZALQT4.mjs} +5 -1
- package/dist/chunk-DTVRFXKI.mjs +35 -0
- package/dist/chunk-EZNZ72VA.mjs +563 -0
- package/dist/{chunk-SPSZZH22.mjs → chunk-LCNFBXB5.mjs} +9 -33
- package/dist/{chunk-IN5HPAPB.mjs → chunk-NNEHWWHL.mjs} +28 -10
- package/dist/chunk-TJ5B56NV.mjs +804 -0
- package/dist/{chunk-XMJABKCF.mjs → chunk-V3VLBQAM.mjs} +1073 -41
- package/dist/cli.mjs +2799 -1176
- package/dist/{client-Ck2nQksT.d.cts → client-B5QBRgIy.d.cts} +2 -0
- package/dist/{client-Ck2nQksT.d.ts → client-B5QBRgIy.d.ts} +2 -0
- package/dist/{client-3AFV2IAF.mjs → client-JWWZWO6L.mjs} +4 -2
- package/dist/index.cjs +1441 -52
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +19 -7
- package/dist/page-IUUTJ3SW.mjs +7 -0
- package/dist/providers.cjs +637 -2
- package/dist/providers.d.cts +2 -2
- package/dist/providers.d.ts +2 -2
- package/dist/providers.mjs +17 -3
- package/dist/{types-CjT0vClo.d.ts → types-BflRmiDz.d.cts} +17 -3
- package/dist/{types-BSoh5v1Y.d.cts → types-BzM-IfsL.d.ts} +17 -3
- package/dist/types-DeVSWhXj.d.cts +142 -0
- package/dist/types-DeVSWhXj.d.ts +142 -0
- package/package.json +1 -1
- package/dist/browser-LZTEHUDI.mjs +0 -9
- package/dist/chunk-BRAFQUMG.mjs +0 -229
- package/dist/types--wXNHUwt.d.cts +0 -56
- package/dist/types--wXNHUwt.d.ts +0 -56
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createProvider,
|
|
3
|
+
resolveBrowserEndpoint
|
|
4
|
+
} from "./chunk-EZNZ72VA.mjs";
|
|
1
5
|
import {
|
|
2
6
|
createCDPClient,
|
|
3
7
|
stringifyUnknown
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
createProvider
|
|
7
|
-
} from "./chunk-BRAFQUMG.mjs";
|
|
8
|
+
} from "./chunk-BVZALQT4.mjs";
|
|
8
9
|
import {
|
|
9
10
|
ActionabilityError,
|
|
10
11
|
BatchExecutor,
|
|
@@ -12,7 +13,7 @@ import {
|
|
|
12
13
|
TimeoutError,
|
|
13
14
|
ensureActionable,
|
|
14
15
|
generateHints
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-V3VLBQAM.mjs";
|
|
16
17
|
|
|
17
18
|
// src/audio/encoding.ts
|
|
18
19
|
function bufferToBase64(data) {
|
|
@@ -143,6 +144,10 @@ async function grantAudioPermissions(cdp, origin) {
|
|
|
143
144
|
await cdp.send("Page.addScriptToEvaluateOnNewDocument", {
|
|
144
145
|
source: PERMISSIONS_OVERRIDE_SCRIPT
|
|
145
146
|
});
|
|
147
|
+
await cdp.send("Runtime.evaluate", {
|
|
148
|
+
expression: PERMISSIONS_OVERRIDE_SCRIPT,
|
|
149
|
+
awaitPromise: false
|
|
150
|
+
});
|
|
146
151
|
}
|
|
147
152
|
var PERMISSIONS_OVERRIDE_SCRIPT = `
|
|
148
153
|
(function() {
|
|
@@ -5382,13 +5387,26 @@ var Browser = class _Browser {
|
|
|
5382
5387
|
* Connect to a browser instance
|
|
5383
5388
|
*/
|
|
5384
5389
|
static async connect(options) {
|
|
5385
|
-
|
|
5386
|
-
|
|
5390
|
+
let connectOptions = options;
|
|
5391
|
+
if (options.provider === "generic" && !options.wsUrl) {
|
|
5392
|
+
const endpoint = await resolveBrowserEndpoint({
|
|
5393
|
+
channel: options.channel,
|
|
5394
|
+
userDataDir: options.userDataDir,
|
|
5395
|
+
allowLocalDiscovery: true,
|
|
5396
|
+
allowLegacyHostFallback: true
|
|
5397
|
+
});
|
|
5398
|
+
connectOptions = {
|
|
5399
|
+
...options,
|
|
5400
|
+
wsUrl: endpoint.wsUrl
|
|
5401
|
+
};
|
|
5402
|
+
}
|
|
5403
|
+
const provider = createProvider(connectOptions);
|
|
5404
|
+
const session = await provider.createSession(connectOptions.session);
|
|
5387
5405
|
const cdp = await createCDPClient(session.wsUrl, {
|
|
5388
|
-
debug:
|
|
5389
|
-
timeout:
|
|
5406
|
+
debug: connectOptions.debug,
|
|
5407
|
+
timeout: connectOptions.timeout
|
|
5390
5408
|
});
|
|
5391
|
-
return new _Browser(cdp, provider, session,
|
|
5409
|
+
return new _Browser(cdp, provider, session, connectOptions);
|
|
5392
5410
|
}
|
|
5393
5411
|
/**
|
|
5394
5412
|
* Get or create a page by name.
|