ant0-browser 0.1.1 → 0.2.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/README.md +112 -4
- package/dist/canvas.d.ts +55 -0
- package/dist/canvas.d.ts.map +1 -0
- package/dist/canvas.js +82 -0
- package/dist/canvas.js.map +1 -0
- package/dist/chromium-version.d.ts +3 -3
- package/dist/chromium-version.js +3 -3
- package/dist/claim-hints.d.ts +36 -0
- package/dist/claim-hints.d.ts.map +1 -0
- package/dist/claim-hints.js +9 -0
- package/dist/claim-hints.js.map +1 -0
- package/dist/cleanup.d.ts +35 -0
- package/dist/cleanup.d.ts.map +1 -0
- package/dist/cleanup.js +106 -0
- package/dist/cleanup.js.map +1 -0
- package/dist/content.d.ts +11 -0
- package/dist/content.d.ts.map +1 -0
- package/dist/content.js +52 -0
- package/dist/content.js.map +1 -0
- package/dist/download.d.ts +2 -0
- package/dist/download.d.ts.map +1 -1
- package/dist/download.js +14 -6
- package/dist/download.js.map +1 -1
- package/dist/errors.d.ts +49 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +53 -0
- package/dist/errors.js.map +1 -0
- package/dist/fingerprint.d.ts +42 -37
- package/dist/fingerprint.d.ts.map +1 -1
- package/dist/fingerprint.js +124 -24
- package/dist/fingerprint.js.map +1 -1
- package/dist/fontpack.d.ts.map +1 -1
- package/dist/fontpack.js +2 -1
- package/dist/fontpack.js.map +1 -1
- package/dist/fonts.js +1 -1
- package/dist/fonts.js.map +1 -1
- package/dist/geoip.d.ts.map +1 -1
- package/dist/geoip.js +3 -2
- package/dist/geoip.js.map +1 -1
- package/dist/geometry.d.ts +4 -0
- package/dist/geometry.d.ts.map +1 -1
- package/dist/geometry.js +9 -3
- package/dist/geometry.js.map +1 -1
- package/dist/identity-persistence.d.ts +38 -1
- package/dist/identity-persistence.d.ts.map +1 -1
- package/dist/identity-persistence.js +90 -10
- package/dist/identity-persistence.js.map +1 -1
- package/dist/identity.d.ts +41 -3
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +199 -26
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +69 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +415 -218
- package/dist/index.js.map +1 -1
- package/dist/launch-ticket.d.ts +109 -5
- package/dist/launch-ticket.d.ts.map +1 -1
- package/dist/launch-ticket.js +327 -11
- package/dist/launch-ticket.js.map +1 -1
- package/dist/launchopts.d.ts +181 -48
- package/dist/launchopts.d.ts.map +1 -1
- package/dist/launchopts.js +470 -51
- package/dist/launchopts.js.map +1 -1
- package/dist/native/linux-x64/PRODUCT-LICENSE.txt +28 -0
- package/dist/native/linux-x64/ant0_runtime.node +0 -0
- package/dist/native/windows-x64/PRODUCT-LICENSE.txt +28 -0
- package/dist/native/windows-x64/ant0_runtime.node +0 -0
- package/dist/persona-migration.d.ts +3 -0
- package/dist/persona-migration.d.ts.map +1 -1
- package/dist/persona-migration.js +2 -0
- package/dist/persona-migration.js.map +1 -1
- package/dist/persona-profile-v2.d.ts +15 -1
- package/dist/persona-profile-v2.d.ts.map +1 -1
- package/dist/persona-profile-v2.js +35 -2
- package/dist/persona-profile-v2.js.map +1 -1
- package/dist/persona-profile-v4.d.ts +61 -0
- package/dist/persona-profile-v4.d.ts.map +1 -0
- package/dist/persona-profile-v4.js +79 -0
- package/dist/persona-profile-v4.js.map +1 -0
- package/dist/persona-rejected.d.ts +36 -0
- package/dist/persona-rejected.d.ts.map +1 -0
- package/dist/persona-rejected.js +40 -0
- package/dist/persona-rejected.js.map +1 -0
- package/dist/population-model.d.ts +3 -0
- package/dist/population-model.d.ts.map +1 -1
- package/dist/population-model.js +24 -3
- package/dist/population-model.js.map +1 -1
- package/dist/profile-file.d.ts +201 -0
- package/dist/profile-file.d.ts.map +1 -0
- package/dist/profile-file.js +736 -0
- package/dist/profile-file.js.map +1 -0
- package/dist/release-fetch.d.ts +4 -0
- package/dist/release-fetch.d.ts.map +1 -1
- package/dist/release-fetch.js +3 -0
- package/dist/release-fetch.js.map +1 -1
- package/dist/render.js +2 -2
- package/dist/render.js.map +1 -1
- package/dist/runtime-client.d.ts +47 -0
- package/dist/runtime-client.d.ts.map +1 -0
- package/dist/runtime-client.js +327 -0
- package/dist/runtime-client.js.map +1 -0
- package/dist/runtime-launch.d.ts +22 -0
- package/dist/runtime-launch.d.ts.map +1 -0
- package/dist/runtime-launch.js +92 -0
- package/dist/runtime-launch.js.map +1 -0
- package/dist/scale.d.ts +29 -0
- package/dist/scale.d.ts.map +1 -0
- package/dist/scale.js +105 -0
- package/dist/scale.js.map +1 -0
- package/dist/shaderdialect.d.ts.map +1 -1
- package/dist/shaderdialect.js +2 -1
- package/dist/shaderdialect.js.map +1 -1
- package/dist/speech-coherence.d.ts +52 -0
- package/dist/speech-coherence.d.ts.map +1 -0
- package/dist/speech-coherence.js +254 -0
- package/dist/speech-coherence.js.map +1 -0
- package/dist/template-selection.d.ts.map +1 -1
- package/dist/template-selection.js +8 -7
- package/dist/template-selection.js.map +1 -1
- package/dist/warnings.d.ts +35 -4
- package/dist/warnings.d.ts.map +1 -1
- package/dist/warnings.js +139 -25
- package/dist/warnings.js.map +1 -1
- package/dist/webgl-coherence.d.ts +30 -0
- package/dist/webgl-coherence.d.ts.map +1 -0
- package/dist/webgl-coherence.js +98 -0
- package/dist/webgl-coherence.js.map +1 -0
- package/dist/webgpu-override.d.ts +14 -0
- package/dist/webgpu-override.d.ts.map +1 -0
- package/dist/webgpu-override.js +82 -0
- package/dist/webgpu-override.js.map +1 -0
- package/dist/widevine.d.ts.map +1 -1
- package/dist/widevine.js +11 -10
- package/dist/widevine.js.map +1 -1
- package/package.json +5 -5
package/dist/launchopts.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/** A Playwright proxy descriptor. */
|
|
2
1
|
export interface PwProxy {
|
|
3
2
|
server?: string;
|
|
4
3
|
username?: string;
|
|
@@ -23,6 +22,14 @@ export declare const PRIVACY_SANDBOX_FEATURES: readonly ["BrowsingTopics", "Brow
|
|
|
23
22
|
* single flag (order-preserving, de-duped) so defaults from different layers + the user's own flags
|
|
24
23
|
* coexist. */
|
|
25
24
|
export declare function mergeFeatureFlags(args: string[]): string[];
|
|
25
|
+
/** Chromium 157+ can keep localStorage/sessionStorage in SQLite (`Default/LocalStorage`) instead of
|
|
26
|
+
* leveldb (`Default/Local Storage`). The features are off by default in 158 and our engine has no
|
|
27
|
+
* field trials, but Chrome for Testing turns them on through its field-trial testing config. Ant0
|
|
28
|
+
* sync only captures the leveldb store, and a migrated profile can't go back, so the SDK always pins
|
|
29
|
+
* the leveldb backend. */
|
|
30
|
+
export declare const DOM_STORAGE_SQLITE_FEATURES: readonly ["DomStorageSqlite", "DomStorageSqliteMigration", "DomStorageSqliteNewDatabases"];
|
|
31
|
+
/** Keep DOM storage on leveldb (always applied; merged by mergeFeatureFlags). */
|
|
32
|
+
export declare function domStorageBackendArgs(): string[];
|
|
26
33
|
/** Disable Privacy Sandbox + intrusive APIs (runtime, no rebuild). */
|
|
27
34
|
export declare function privacySandboxArgs(): string[];
|
|
28
35
|
/** Behind a proxy, real Chrome cannot use QUIC/HTTP3 (a SOCKS5/HTTP proxy carries only TCP), so it
|
|
@@ -30,59 +37,34 @@ export declare function privacySandboxArgs(): string[];
|
|
|
30
37
|
* coherent with proxied Chrome, and a guarantee no UDP egresses around the proxy. No proxy -> leave
|
|
31
38
|
* QUIC on (real Chrome uses it). */
|
|
32
39
|
export declare function quicArgs(proxy: PwProxy | undefined): string[];
|
|
33
|
-
/**
|
|
34
|
-
* it egress on the host's own path.
|
|
35
|
-
*
|
|
36
|
-
* This is the transport the {@link webrtcDefaultDenyArgs} note asks for. That default sets
|
|
37
|
-
* `disable_non_proxied_udp`, which on stock Chromium means "no UDP at all", because stock Chromium
|
|
38
|
-
* has no way to proxy a datagram — so peer connections that genuinely need UDP simply fail. With
|
|
39
|
-
* this option the engine opens a UDP association through the proxy and relays every datagram over
|
|
40
|
-
* it, so UDP works AND still leaves from the proxy's address. The two compose: measured against the
|
|
41
|
-
* proxy's own log, the association is established with the deny policy in force, so enabling this
|
|
42
|
-
* does not require weakening the policy.
|
|
43
|
-
*
|
|
44
|
-
* Emitted only for a `socks5://` proxy. UDP ASSOCIATE is a SOCKS5 command — SOCKS4 has no
|
|
45
|
-
* equivalent, and an HTTP proxy carries only TCP — so with any other scheme the switch would be
|
|
46
|
-
* accepted and silently do nothing, which is worse than not sending it.
|
|
47
|
-
*
|
|
48
|
-
* Requires engine support; older binaries ignore the switch. Off by default: it is a real
|
|
49
|
-
* behaviour change (UDP starts flowing where the deny policy previously stopped it), and a proxy
|
|
50
|
-
* that advertises SOCKS5 but refuses ASSOCIATE — common among cheap residential pools — leaves the
|
|
51
|
-
* connection no worse off but no better either. */
|
|
52
|
-
export declare function socks5UdpArgs(socks5Udp: boolean | undefined, proxy: PwProxy | undefined): string[];
|
|
53
|
-
/** Default WebRTC to disable_non_proxied_udp, so no UDP can egress around the proxy.
|
|
40
|
+
/** Emit `--socks5-udp` for a `socks5://` proxy when the caller asks for it.
|
|
54
41
|
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
42
|
+
* WARNING: the engine does NOT implement this switch today. Neither the patch series nor the
|
|
43
|
+
* Chromium tree it builds contains a `--socks5-udp` handler (two independent source reads), so
|
|
44
|
+
* Chromium ignores it: no UDP is relayed through the proxy, and the deny policy
|
|
45
|
+
* (`disable_non_proxied_udp`, see {@link webrtcDefaultDenyArgs}) still blocks peer-to-peer UDP.
|
|
46
|
+
* The option is kept so existing callers do not break and so engine support can land later; do not
|
|
47
|
+
* rely on it to make WebRTC UDP work through a proxy.
|
|
57
48
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
|
|
61
|
-
*
|
|
62
|
-
* A page that sets `iceTransportPolicy: "relay"` forces the browser to talk to its own TURN server.
|
|
63
|
-
* TURN prefers UDP and an HTTP/SOCKS proxy carries only TCP, so that UDP left on the host's own
|
|
64
|
-
* path and the TURN server read the real public address straight off the packet — no candidate
|
|
65
|
-
* involved, so fabricating one changed nothing. Reported by a customer whose session was flagged
|
|
66
|
-
* for location spoofing with an otherwise perfectly coherent persona.
|
|
67
|
-
*
|
|
68
|
-
* Worse, `geoip: true` sets `webrtcIp` for you, so the more carefully a caller configured for
|
|
69
|
-
* coherence the more likely they had silently lost this. Now only an explicit policy from the
|
|
70
|
-
* caller suppresses it.
|
|
71
|
-
*
|
|
72
|
-
* Note this is a real trade-off, not a free win: denying non-proxied UDP means peer connections
|
|
73
|
-
* that genuinely need UDP will not establish. Callers who need working WebRTC through a proxy want
|
|
74
|
-
* a transport that actually carries UDP (SOCKS5 with UDP ASSOCIATE, or a full tunnel) and can set
|
|
75
|
-
* their own policy to opt out. */
|
|
49
|
+
* Emitted only for a `socks5://` proxy (UDP ASSOCIATE, RFC 1928 section 7, is a SOCKS5 command; SOCKS4
|
|
50
|
+
* and HTTP proxies have no equivalent). Off by default. */
|
|
51
|
+
export declare function socks5UdpArgs(socks5Udp: boolean | undefined, proxy: PwProxy | undefined): string[];
|
|
76
52
|
/**
|
|
77
|
-
* Switches to expose `navigator.bluetooth`
|
|
53
|
+
* Switches to expose `navigator.bluetooth` for a persona that is NOT Linux, on a Linux host.
|
|
78
54
|
*
|
|
79
55
|
* Web Bluetooth is compiled into the engine but runtime-disabled on Linux only:
|
|
80
56
|
* Chromium's runtime_enabled_features.json5 gives WebBluetooth status "stable" on Win/Mac/Android/
|
|
81
57
|
* ChromeOS and lets Linux fall through to "default": "experimental", and content_features.cc
|
|
82
|
-
* declares kWebBluetooth FEATURE_DISABLED_BY_DEFAULT. So a Linux host serving a Windows
|
|
83
|
-
* reports navigator.usb, navigator.serial and navigator.hid but NOT navigator.bluetooth -
|
|
84
|
-
* combination no real Windows Chrome produces, and an OS-origin tell that survives every
|
|
85
|
-
* spoof. One flag restores it on the shipped binary; no rebuild is involved.
|
|
58
|
+
* declares kWebBluetooth FEATURE_DISABLED_BY_DEFAULT. So a Linux host serving a Windows or macOS
|
|
59
|
+
* persona reports navigator.usb, navigator.serial and navigator.hid but NOT navigator.bluetooth -
|
|
60
|
+
* a combination no real Windows or macOS Chrome produces, and an OS-origin tell that survives every
|
|
61
|
+
* string spoof. One flag restores it on the shipped binary; no rebuild is involved.
|
|
62
|
+
*
|
|
63
|
+
* The flag depends on the persona, not on the host alone. Real Linux Chrome has NO
|
|
64
|
+
* navigator.bluetooth, so a Linux persona (and a launch with no persona, which presents the real
|
|
65
|
+
* host) must not get it: adding it there would itself be the tell. `personaPlatform` is the
|
|
66
|
+
* effective persona platform (`windows` | `macos` | `linux`); `null` or empty means no persona, so
|
|
67
|
+
* nothing is emitted; omitting the argument keeps the old public behaviour (flag on a Linux host). `hostPlatform` is injectable for tests.
|
|
86
68
|
*
|
|
87
69
|
* Verified against Chromium 150's bluetooth.idl: getDevices() is gated on WebBluetoothGetDevices
|
|
88
70
|
* and requestLEScan()/onadvertisementreceived on WebBluetoothScanning, both "experimental", so
|
|
@@ -90,7 +72,151 @@ export declare function socks5UdpArgs(socks5Udp: boolean | undefined, proxy: PwP
|
|
|
90
72
|
* this flag produces. getAvailability() resolves false and requestDevice() rejects NotFoundError
|
|
91
73
|
* on a machine with no adapter, matching a real desktop without Bluetooth hardware.
|
|
92
74
|
*/
|
|
93
|
-
export declare function webBluetoothArgs(): string[];
|
|
75
|
+
export declare function webBluetoothArgs(personaPlatform?: string | null, hostPlatform?: string): string[];
|
|
76
|
+
/** Effective persona platform of a launch: the resolved `platform` option, else the captured
|
|
77
|
+
* profile's `compatibility.os_family`. Undefined when there is no persona (native identity). */
|
|
78
|
+
export declare function personaPlatformOf(platform: unknown, profile?: unknown): string | undefined;
|
|
79
|
+
/** Playwright default launch args this SDK always removes (a caller's own `ignoreDefaultArgs` wins).
|
|
80
|
+
*
|
|
81
|
+
* - `--enable-automation` flips the AutomationControlled feature and webdriver-adjacent tells.
|
|
82
|
+
* - `--disable-ipc-flooding-protection` turns off Chromium's IPC flooding protection, which real
|
|
83
|
+
* Chrome keeps on (`ipcFloodingProtection` in the self-check). With it off, a burst of
|
|
84
|
+
* renderer-to-browser IPC is not throttled as it is in a real browser. */
|
|
85
|
+
export declare const IGNORED_PLAYWRIGHT_DEFAULTS: readonly string[];
|
|
86
|
+
/** Playwright testing switches `launch()` / `launchPersistentContext()` do not pass, because a page can
|
|
87
|
+
* observe them: `--hide-scrollbars` (`innerWidth - clientWidth` is 0 instead of the scrollbar width) and
|
|
88
|
+
* `--disable-popup-blocking` (`window.open()` without a user gesture returns a Window instead of null).
|
|
89
|
+
* Removing them breaks no Playwright automation (measured, tools/launch-switches). They go into
|
|
90
|
+
* `ignoreDefaultArgs` unless the caller passes the switch itself in `args`: Playwright's
|
|
91
|
+
* `ignoreDefaultArgs` also filters the caller's own `args`, so ignoring it then would drop the caller's
|
|
92
|
+
* switch. `serve()` / `launchPlan()` never had them. */
|
|
93
|
+
export declare const DROPPED_PLAYWRIGHT_SWITCHES: readonly string[];
|
|
94
|
+
/** Playwright default disabled features the launch paths stop disabling, because a page can observe
|
|
95
|
+
* them: `HttpsUpgrades` (http: navigations upgrade to https: when TLS answers) and
|
|
96
|
+
* `BoundaryEventDispatchTracksNodeRemoval` (extra `mouseenter` events after the pointed-at node is
|
|
97
|
+
* removed). A caller's own `--disable-features` is merged after the defaults and keeps them. */
|
|
98
|
+
export declare const DROPPED_PLAYWRIGHT_DISABLED_FEATURES: readonly string[];
|
|
99
|
+
/** Kept disabled on every launch path. playwright-core 1.61 does not disable it (1.65 does), and with it
|
|
100
|
+
* on (and HttpsUpgrades off) `http://` fails `ERR_BLOCKED_BY_CLIENT` on a host without TLS. Off, http:
|
|
101
|
+
* upgrades to https: when TLS works and falls back to http: when it does not, as in a normal Chrome. */
|
|
102
|
+
export declare const PLAYWRIGHT_KEPT_DISABLED_FEATURE = "HttpsFirstBalancedModeAutoEnable";
|
|
103
|
+
/** The one feature Playwright disables by default that real Chrome does not. Disabling it makes a
|
|
104
|
+
* cross-site iframe's `localStorage` read back UNPARTITIONED (a site can track across top-level
|
|
105
|
+
* sites inside one profile) or throw `SecurityError`, where real Chrome reads a partitioned `null`.
|
|
106
|
+
* It is not in this SDK's own lists and never was (git history): it comes from Playwright's defaults. */
|
|
107
|
+
export declare const PLAYWRIGHT_UNWANTED_DISABLED_FEATURE = "ThirdPartyStoragePartitioning";
|
|
108
|
+
export interface PlaywrightFeatureDefaults {
|
|
109
|
+
/** Playwright's whole default `--disable-features` list, as it emits it. */
|
|
110
|
+
disabledFull: string[];
|
|
111
|
+
/** The same list without {@link PLAYWRIGHT_UNWANTED_DISABLED_FEATURE}. */
|
|
112
|
+
disabled: string[];
|
|
113
|
+
/** Playwright's default `--enable-features` (for example `CDPScreenshotNewSurface`). */
|
|
114
|
+
enabled: string[];
|
|
115
|
+
}
|
|
116
|
+
/** Read Playwright's default feature switches out of its source text. Undefined unless the
|
|
117
|
+
* `disabledFeatures` array is plain quoted names (comments allowed) and contains
|
|
118
|
+
* {@link PLAYWRIGHT_UNWANTED_DISABLED_FEATURE}, and the enabled list is found where Playwright builds
|
|
119
|
+
* its switch; anything else (another layout, conditional entries) is not guessed at. `env` resolves the
|
|
120
|
+
* `process.env.X ? "" : "Name"` entries (default `process.env`). */
|
|
121
|
+
export declare function parsePlaywrightFeatureDefaults(source: string, env?: Record<string, string | undefined>): PlaywrightFeatureDefaults | undefined;
|
|
122
|
+
/** Back-compat helper: the disabled list without the unwanted feature, or undefined. */
|
|
123
|
+
export declare function parsePlaywrightDisabledFeatures(source: string): string[] | undefined;
|
|
124
|
+
/** Playwright's default feature switches derived from the Playwright that is actually installed (its
|
|
125
|
+
* source, `lib/coreBundle.js` or `lib/server/chromium/chromiumSwitches.js`), so a different resolved
|
|
126
|
+
* version cannot be silently replaced by a stale copy. Undefined when it cannot be derived. */
|
|
127
|
+
export declare function installedPlaywrightFeatureDefaults(): PlaywrightFeatureDefaults | undefined;
|
|
128
|
+
export declare function installedPlaywrightDisabledFeatures(): string[] | undefined;
|
|
129
|
+
/** Playwright's `--disable-features` / `--enable-features` defaults, minus
|
|
130
|
+
* ThirdPartyStoragePartitioning, for a Playwright launch only (a direct spawn has no Playwright
|
|
131
|
+
* defaults). Put them in FRONT of the engine args and run {@link mergeFeatureFlags}: the SDK's own
|
|
132
|
+
* and the caller's flags then merge with Playwright's lists instead of replacing them (Chromium
|
|
133
|
+
* honours only the last of each). Empty when Playwright's defaults are ignored, or when they cannot
|
|
134
|
+
* be derived from the installed Playwright (warned once; Playwright's own list then stays, and an
|
|
135
|
+
* SDK or caller `--disable-features` replaces it, so the launch paths skip the DOM storage pin then). `defaults` is injectable for tests. */
|
|
136
|
+
export declare function playwrightFeatureArgs(args: readonly string[], ignoreDefaultArgs?: unknown, defaults?: PlaywrightFeatureDefaults | string[] | null | undefined, quiet?: boolean): string[];
|
|
137
|
+
/** The engine args with Playwright's feature defaults merged in (see {@link playwrightFeatureArgs}). */
|
|
138
|
+
export declare function withPlaywrightFeatureDefaults(args: string[], ignoreDefaultArgs?: unknown, quiet?: boolean, defaults?: PlaywrightFeatureDefaults | string[] | null | undefined): string[];
|
|
139
|
+
/** `--proxy-bypass-list` for a Playwright proxy's `bypass` (comma separated), for the direct
|
|
140
|
+
* `serve()` / `launchPlan()` spawn. Same rule translation Playwright applies (trim, leading `.` ->
|
|
141
|
+
* `*.`, `;` joined). Playwright also forces `<-loopback>` through the proxy; a direct spawn keeps
|
|
142
|
+
* Chromium's own loopback bypass, so that rule is deliberately not added. Empty without a proxy
|
|
143
|
+
* server or a bypass. */
|
|
144
|
+
export declare function proxyBypassArgs(proxy: {
|
|
145
|
+
server?: string;
|
|
146
|
+
bypass?: string;
|
|
147
|
+
} | undefined): string[];
|
|
148
|
+
/** The SDK's ignored Playwright defaults plus the caller's own, so a caller's `ignoreDefaultArgs`
|
|
149
|
+
* adds to them and can never bring `--enable-automation` or `--disable-ipc-flooding-protection` back.
|
|
150
|
+
* `true` (ignore every default) is kept as is. `--hide-scrollbars` and `--disable-popup-blocking` are added
|
|
151
|
+
* too (see {@link DROPPED_PLAYWRIGHT_SWITCHES}), except one the caller passes in `args` themselves. */
|
|
152
|
+
export declare function mergeIgnoreDefaultArgs(caller: unknown, args?: readonly string[]): string[] | true;
|
|
153
|
+
/** First engine release that holds `--webrtc-ip` without re-enabling non-proxied UDP. */
|
|
154
|
+
export declare const WEBRTC_IP_MIN_ENGINE = "158.0.8127.18-ant0.3";
|
|
155
|
+
/** True only for a parseable engine release at or after {@link WEBRTC_IP_MIN_ENGINE}, compared
|
|
156
|
+
* numerically field by field (the four-part Chromium version, then the `-ant0.N` build). Unknown,
|
|
157
|
+
* missing or unparseable counts as old: the safe path is to omit the flag. */
|
|
158
|
+
export declare function engineSupportsWebrtcIp(engineVersion: unknown): boolean;
|
|
159
|
+
/** True for a plain IPv4 or IPv6 address (no brackets, zone id, port or whitespace). */
|
|
160
|
+
export declare function isValidWebrtcIp(value: unknown): boolean;
|
|
161
|
+
/** The WebRTC IP handling policy that is actually in force from the switches: the last non-empty
|
|
162
|
+
* `--force-webrtc-ip-handling-policy`, else the last non-empty `--webrtc-ip-handling-policy`
|
|
163
|
+
* (the force variant wins in Chromium). An empty or bare switch sets nothing. */
|
|
164
|
+
export declare function effectiveWebrtcPolicy(args: readonly string[]): string | undefined;
|
|
165
|
+
/** True only when the policy in force lets non-proxied UDP out (anything but
|
|
166
|
+
* `disable_non_proxied_udp`). They chose to leave the protection, so a dropped `--webrtc-ip` is not
|
|
167
|
+
* ours to enforce there: today's behaviour is kept. */
|
|
168
|
+
export declare function callerAllowsUdp(args: readonly string[]): boolean;
|
|
169
|
+
/** True when the switches themselves configure a proxy (`--proxy-server=...`, any spelling) and no
|
|
170
|
+
* `--no-proxy-server` cancels it. `direct://` is no proxy. */
|
|
171
|
+
export declare function hasRawProxyServer(args: readonly string[]): boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Drop `--webrtc-ip=...` from the final engine args when the engine is older than
|
|
174
|
+
* {@link WEBRTC_IP_MIN_ENGINE}.
|
|
175
|
+
*
|
|
176
|
+
* Why: engines through 158.0.8127.18-ant0.2 turn non-proxied UDP back on whenever `--webrtc-ip`
|
|
177
|
+
* is set, even with `--webrtc-ip-handling-policy=disable_non_proxied_udp`. A page that points ICE
|
|
178
|
+
* at its own TURN server or peer then gets UDP from the host's real public address (measured: 133
|
|
179
|
+
* packets to a test range with the flag, 0 without). ant0.3 fixes it in the engine.
|
|
180
|
+
*
|
|
181
|
+
* Applied to the final list, so it covers the option, a geo-derived value and a raw
|
|
182
|
+
* `--webrtc-ip=` in caller args alike. A caller policy that allows UDP opts out (see
|
|
183
|
+
* callerAllowsUdp). A warning is written when a value is dropped; it never contains the address.
|
|
184
|
+
*/
|
|
185
|
+
export declare function gateWebrtcIpArgs(args: string[], engineVersion: string | null | undefined, quiet?: boolean): string[];
|
|
186
|
+
/** Switch (engine 158.0.8127.18-ant0.3 and later) that stops WebRTC looking up page-chosen hostnames
|
|
187
|
+
* (TURN/STUN servers, `.local` candidates) on the host's own resolver, which would otherwise happen
|
|
188
|
+
* outside the proxy. */
|
|
189
|
+
export declare const WEBRTC_NO_LOCAL_DNS = "--webrtc-no-local-dns";
|
|
190
|
+
/**
|
|
191
|
+
* {@link gateWebrtcIpArgs}, plus `--webrtc-no-local-dns` on every launch that has a proxy (the
|
|
192
|
+
* daemon's credential relay included) when the engine is at {@link WEBRTC_IP_MIN_ENGINE} or later
|
|
193
|
+
* (the same version check as `--webrtc-ip`; unknown counts as old). Not added without a proxy, or
|
|
194
|
+
* when the caller's own WebRTC policy allows UDP, or when it is already in the args, or in UDP
|
|
195
|
+
* relay mode (`--webrtc-udp-relay`; the engine ignores it there, see docs/SOCKS5-UDP-RELAY.md).
|
|
196
|
+
*/
|
|
197
|
+
export declare function gateWebrtcArgs(args: string[], engineVersion: string | null | undefined, quiet: boolean | undefined, hasProxy: boolean): string[];
|
|
198
|
+
/** Default WebRTC to disable_non_proxied_udp, so no UDP can egress around the proxy.
|
|
199
|
+
*
|
|
200
|
+
* This used to be skipped whenever `webrtcIp` was set, on the theory that the engine's srflx
|
|
201
|
+
* fabrication already covered WebRTC. It does not - the two defend different things:
|
|
202
|
+
*
|
|
203
|
+
* - fabrication rewrites what the browser *reports*, which beats a page that reads the candidate;
|
|
204
|
+
* - this policy stops UDP *leaving the machine*, which beats a server that watches where packets
|
|
205
|
+
* arrive from.
|
|
206
|
+
*
|
|
207
|
+
* A page that sets `iceTransportPolicy: "relay"` forces the browser to talk to its own TURN server.
|
|
208
|
+
* TURN prefers UDP and an HTTP/SOCKS proxy carries only TCP, so that UDP left on the host's own
|
|
209
|
+
* path and the TURN server read the real public address straight off the packet - no candidate
|
|
210
|
+
* involved, so fabricating one changed nothing.
|
|
211
|
+
*
|
|
212
|
+
* CAVEAT (measured): on engines older than 158.0.8127.18-ant0.3 this policy is NOT enough on its
|
|
213
|
+
* own. Setting `--webrtc-ip` makes those engines re-enable non-proxied UDP, overriding the policy.
|
|
214
|
+
* So the SDK omits `--webrtc-ip` for them (see gateWebrtcIpArgs) and the policy then holds.
|
|
215
|
+
* ant0.3 and later keep the policy in force with `--webrtc-ip` set.
|
|
216
|
+
*
|
|
217
|
+
* This is a real trade-off, not a free win: denying non-proxied UDP means peer connections that
|
|
218
|
+
* genuinely need UDP will not establish. Callers who need working WebRTC can set their own policy
|
|
219
|
+
* to opt out; a policy that allows UDP also keeps `--webrtc-ip` on any engine. */
|
|
94
220
|
export declare function webrtcDefaultDenyArgs(args: string[], _webrtcIp?: unknown): string[];
|
|
95
221
|
/** Switches to load unpacked extensions. Chromium needs BOTH --load-extension=<dirs> and
|
|
96
222
|
* --disable-extensions-except=<dirs> (the latter keeps the listed extensions enabled while
|
|
@@ -130,4 +256,11 @@ export declare function resolveProxy(proxy: PwProxy | undefined): {
|
|
|
130
256
|
args: string[];
|
|
131
257
|
proxy: PwProxy | undefined;
|
|
132
258
|
};
|
|
259
|
+
/** Switches only the engine sets. `--ant0-persona-handle` carries the accepted persona to renderer
|
|
260
|
+
* processes (patch 937); a browser-process value would be ignored at best, so the SDK neither emits it
|
|
261
|
+
* nor lets a caller's own args do so. */
|
|
262
|
+
export declare const RESERVED_ENGINE_SWITCHES: readonly ["--ant0-persona-handle"];
|
|
263
|
+
/** Throw `sdk.launch_option_unsupported` when `args` contains an engine-reserved switch, in any spelling
|
|
264
|
+
* Chromium parses: `--name`, `-name` or `/name` (any case), with or without `=value`. */
|
|
265
|
+
export declare function assertNoReservedArgs(args: readonly unknown[]): void;
|
|
133
266
|
//# sourceMappingURL=launchopts.d.ts.map
|
package/dist/launchopts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launchopts.d.ts","sourceRoot":"","sources":["../src/launchopts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"launchopts.d.ts","sourceRoot":"","sources":["../src/launchopts.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,OAAO;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;kFAWkF;AAClF,eAAO,MAAM,wBAAwB,yJAG3B,CAAC;AAEX;;;cAGc;AACd,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAa1D;AAED;;;;0BAI0B;AAC1B,eAAO,MAAM,2BAA2B,4FAE9B,CAAC;AAEX,iFAAiF;AACjF,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAEhD;AAED,sEAAsE;AACtE,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAE7C;AAED;;;oCAGoC;AACpC,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,EAAE,CAE7D;AAED;;;;;;;;;;2DAU2D;AAC3D,wBAAgB,aAAa,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,KAAK,EAAE,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