ant0-browser 0.0.0-stage → 0.2.0-beta.2

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.
Files changed (163) hide show
  1. package/LICENSE +35 -0
  2. package/README.md +208 -2
  3. package/dist/canvas.d.ts +55 -0
  4. package/dist/canvas.d.ts.map +1 -0
  5. package/dist/canvas.js +82 -0
  6. package/dist/canvas.js.map +1 -0
  7. package/dist/chromium-version.d.ts +22 -0
  8. package/dist/chromium-version.d.ts.map +1 -0
  9. package/dist/chromium-version.js +22 -0
  10. package/dist/chromium-version.js.map +1 -0
  11. package/dist/claim-hints.d.ts +36 -0
  12. package/dist/claim-hints.d.ts.map +1 -0
  13. package/dist/claim-hints.js +9 -0
  14. package/dist/claim-hints.js.map +1 -0
  15. package/dist/cleanup.d.ts +35 -0
  16. package/dist/cleanup.d.ts.map +1 -0
  17. package/dist/cleanup.js +106 -0
  18. package/dist/cleanup.js.map +1 -0
  19. package/dist/content.d.ts +11 -0
  20. package/dist/content.d.ts.map +1 -0
  21. package/dist/content.js +52 -0
  22. package/dist/content.js.map +1 -0
  23. package/dist/download.d.ts +24 -0
  24. package/dist/download.d.ts.map +1 -0
  25. package/dist/download.js +227 -0
  26. package/dist/download.js.map +1 -0
  27. package/dist/errors.d.ts +49 -0
  28. package/dist/errors.d.ts.map +1 -0
  29. package/dist/errors.js +53 -0
  30. package/dist/errors.js.map +1 -0
  31. package/dist/fingerprint.d.ts +218 -0
  32. package/dist/fingerprint.d.ts.map +1 -0
  33. package/dist/fingerprint.js +475 -0
  34. package/dist/fingerprint.js.map +1 -0
  35. package/dist/fontpack.d.ts +13 -0
  36. package/dist/fontpack.d.ts.map +1 -0
  37. package/dist/fontpack.js +150 -0
  38. package/dist/fontpack.js.map +1 -0
  39. package/dist/fonts.d.ts +15 -0
  40. package/dist/fonts.d.ts.map +1 -0
  41. package/dist/fonts.js +86 -0
  42. package/dist/fonts.js.map +1 -0
  43. package/dist/geoip.d.ts +45 -0
  44. package/dist/geoip.d.ts.map +1 -0
  45. package/dist/geoip.js +290 -0
  46. package/dist/geoip.js.map +1 -0
  47. package/dist/geometry.d.ts +32 -0
  48. package/dist/geometry.d.ts.map +1 -0
  49. package/dist/geometry.js +85 -0
  50. package/dist/geometry.js.map +1 -0
  51. package/dist/humanize.d.ts +20 -0
  52. package/dist/humanize.d.ts.map +1 -0
  53. package/dist/humanize.js +921 -0
  54. package/dist/humanize.js.map +1 -0
  55. package/dist/identity-persistence.d.ts +88 -0
  56. package/dist/identity-persistence.d.ts.map +1 -0
  57. package/dist/identity-persistence.js +381 -0
  58. package/dist/identity-persistence.js.map +1 -0
  59. package/dist/identity.d.ts +81 -0
  60. package/dist/identity.d.ts.map +1 -0
  61. package/dist/identity.js +370 -0
  62. package/dist/identity.js.map +1 -0
  63. package/dist/index.d.ts +281 -0
  64. package/dist/index.d.ts.map +1 -0
  65. package/dist/index.js +790 -0
  66. package/dist/index.js.map +1 -0
  67. package/dist/launch-ticket.d.ts +191 -0
  68. package/dist/launch-ticket.d.ts.map +1 -0
  69. package/dist/launch-ticket.js +549 -0
  70. package/dist/launch-ticket.js.map +1 -0
  71. package/dist/launchopts.d.ts +266 -0
  72. package/dist/launchopts.d.ts.map +1 -0
  73. package/dist/launchopts.js +623 -0
  74. package/dist/launchopts.js.map +1 -0
  75. package/dist/motion.d.ts +106 -0
  76. package/dist/motion.d.ts.map +1 -0
  77. package/dist/motion.js +311 -0
  78. package/dist/motion.js.map +1 -0
  79. package/dist/motionscore.d.ts +57 -0
  80. package/dist/motionscore.d.ts.map +1 -0
  81. package/dist/motionscore.js +215 -0
  82. package/dist/motionscore.js.map +1 -0
  83. package/dist/native/linux-x64/PRODUCT-LICENSE.txt +28 -0
  84. package/dist/native/linux-x64/ant0_runtime.node +0 -0
  85. package/dist/native/windows-x64/PRODUCT-LICENSE.txt +28 -0
  86. package/dist/native/windows-x64/ant0_runtime.node +0 -0
  87. package/dist/persona-migration.d.ts +54 -0
  88. package/dist/persona-migration.d.ts.map +1 -0
  89. package/dist/persona-migration.js +97 -0
  90. package/dist/persona-migration.js.map +1 -0
  91. package/dist/persona-profile-v2.d.ts +169 -0
  92. package/dist/persona-profile-v2.d.ts.map +1 -0
  93. package/dist/persona-profile-v2.js +454 -0
  94. package/dist/persona-profile-v2.js.map +1 -0
  95. package/dist/persona-profile-v4.d.ts +61 -0
  96. package/dist/persona-profile-v4.d.ts.map +1 -0
  97. package/dist/persona-profile-v4.js +79 -0
  98. package/dist/persona-profile-v4.js.map +1 -0
  99. package/dist/persona-rejected.d.ts +36 -0
  100. package/dist/persona-rejected.d.ts.map +1 -0
  101. package/dist/persona-rejected.js +40 -0
  102. package/dist/persona-rejected.js.map +1 -0
  103. package/dist/population-model.d.ts +45 -0
  104. package/dist/population-model.d.ts.map +1 -0
  105. package/dist/population-model.js +245 -0
  106. package/dist/population-model.js.map +1 -0
  107. package/dist/profile-file.d.ts +201 -0
  108. package/dist/profile-file.d.ts.map +1 -0
  109. package/dist/profile-file.js +736 -0
  110. package/dist/profile-file.js.map +1 -0
  111. package/dist/release-fetch.d.ts +74 -0
  112. package/dist/release-fetch.d.ts.map +1 -0
  113. package/dist/release-fetch.js +395 -0
  114. package/dist/release-fetch.js.map +1 -0
  115. package/dist/release.d.ts +16 -0
  116. package/dist/release.d.ts.map +1 -0
  117. package/dist/release.js +26 -0
  118. package/dist/release.js.map +1 -0
  119. package/dist/render.d.ts +38 -0
  120. package/dist/render.d.ts.map +1 -0
  121. package/dist/render.js +104 -0
  122. package/dist/render.js.map +1 -0
  123. package/dist/runtime-client.d.ts +47 -0
  124. package/dist/runtime-client.d.ts.map +1 -0
  125. package/dist/runtime-client.js +327 -0
  126. package/dist/runtime-client.js.map +1 -0
  127. package/dist/runtime-launch.d.ts +22 -0
  128. package/dist/runtime-launch.d.ts.map +1 -0
  129. package/dist/runtime-launch.js +92 -0
  130. package/dist/runtime-launch.js.map +1 -0
  131. package/dist/scale.d.ts +29 -0
  132. package/dist/scale.d.ts.map +1 -0
  133. package/dist/scale.js +105 -0
  134. package/dist/scale.js.map +1 -0
  135. package/dist/shaderdialect.d.ts +33 -0
  136. package/dist/shaderdialect.d.ts.map +1 -0
  137. package/dist/shaderdialect.js +47 -0
  138. package/dist/shaderdialect.js.map +1 -0
  139. package/dist/speech-coherence.d.ts +52 -0
  140. package/dist/speech-coherence.d.ts.map +1 -0
  141. package/dist/speech-coherence.js +254 -0
  142. package/dist/speech-coherence.js.map +1 -0
  143. package/dist/template-selection.d.ts +14 -0
  144. package/dist/template-selection.d.ts.map +1 -0
  145. package/dist/template-selection.js +66 -0
  146. package/dist/template-selection.js.map +1 -0
  147. package/dist/warnings.d.ts +50 -0
  148. package/dist/warnings.d.ts.map +1 -0
  149. package/dist/warnings.js +273 -0
  150. package/dist/warnings.js.map +1 -0
  151. package/dist/webgl-coherence.d.ts +30 -0
  152. package/dist/webgl-coherence.d.ts.map +1 -0
  153. package/dist/webgl-coherence.js +98 -0
  154. package/dist/webgl-coherence.js.map +1 -0
  155. package/dist/webgpu-override.d.ts +14 -0
  156. package/dist/webgpu-override.d.ts.map +1 -0
  157. package/dist/webgpu-override.js +82 -0
  158. package/dist/webgpu-override.js.map +1 -0
  159. package/dist/widevine.d.ts +44 -0
  160. package/dist/widevine.d.ts.map +1 -0
  161. package/dist/widevine.js +203 -0
  162. package/dist/widevine.js.map +1 -0
  163. package/package.json +56 -4
@@ -0,0 +1,266 @@
1
+ export interface PwProxy {
2
+ server?: string;
3
+ username?: string;
4
+ password?: string;
5
+ bypass?: string;
6
+ }
7
+ /** Privacy Sandbox + intrusive web APIs a de-Googled stealth build should not expose (a build that
8
+ * claims de-Googled while still answering document.browsingTopics()/navigator.runAdAuction is a
9
+ * self-contradictory, pivotable fingerprint). All are runtime base::Features, so disabling needs
10
+ * no rebuild.
11
+ *
12
+ * WebUSB is deliberately NOT in this list. It is not a Privacy Sandbox feature - it is a device
13
+ * API that ships alongside Web Serial, WebHID and Web Bluetooth under identical secure-context
14
+ * gating. Disabling only WebUSB left navigator.usb absent while serial/hid/bluetooth stayed
15
+ * present, a combination no real Chromium produces; measured against stock Chrome on the same
16
+ * host, that split was the single flagged difference in the device-API family. Presence leaks
17
+ * nothing on its own - the API is permission-gated and enumerates no device without a user
18
+ * gesture - so exposing it costs no privacy and removes a hard coherence tell. */
19
+ export declare const PRIVACY_SANDBOX_FEATURES: readonly ["BrowsingTopics", "BrowsingTopicsDocumentAPI", "Fledge", "InterestGroupStorage", "PrivateAggregationApi", "SharedStorageAPI", "FencedFrames"];
20
+ /** Chromium honors only the LAST --enable-features / --disable-features on the command line (they
21
+ * do NOT concatenate), so multiple occurrences clobber each other. Collapse all of each into a
22
+ * single flag (order-preserving, de-duped) so defaults from different layers + the user's own flags
23
+ * coexist. */
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[];
33
+ /** Disable Privacy Sandbox + intrusive APIs (runtime, no rebuild). */
34
+ export declare function privacySandboxArgs(): string[];
35
+ /** Behind a proxy, real Chrome cannot use QUIC/HTTP3 (a SOCKS5/HTTP proxy carries only TCP), so it
36
+ * falls back to TCP. Disable QUIC when a proxy is configured so no HTTP/3 UDP is attempted —
37
+ * coherent with proxied Chrome, and a guarantee no UDP egresses around the proxy. No proxy -> leave
38
+ * QUIC on (real Chrome uses it). */
39
+ export declare function quicArgs(proxy: PwProxy | undefined): string[];
40
+ /** Emit `--socks5-udp` for a `socks5://` proxy when the caller asks for it.
41
+ *
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.
48
+ *
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[];
52
+ /**
53
+ * Switches to expose `navigator.bluetooth` for a persona that is NOT Linux, on a Linux host.
54
+ *
55
+ * Web Bluetooth is compiled into the engine but runtime-disabled on Linux only:
56
+ * Chromium's runtime_enabled_features.json5 gives WebBluetooth status "stable" on Win/Mac/Android/
57
+ * ChromeOS and lets Linux fall through to "default": "experimental", and content_features.cc
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.
68
+ *
69
+ * Verified against Chromium 150's bluetooth.idl: getDevices() is gated on WebBluetoothGetDevices
70
+ * and requestLEScan()/onadvertisementreceived on WebBluetoothScanning, both "experimental", so
71
+ * real stable Chrome exposes exactly {constructor, getAvailability, requestDevice} - which is what
72
+ * this flag produces. getAvailability() resolves false and requestDevice() rejects NotFoundError
73
+ * on a machine with no adapter, matching a real desktop without Bluetooth hardware.
74
+ */
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. */
220
+ export declare function webrtcDefaultDenyArgs(args: string[], _webrtcIp?: unknown): string[];
221
+ /** Switches to load unpacked extensions. Chromium needs BOTH --load-extension=<dirs> and
222
+ * --disable-extensions-except=<dirs> (the latter keeps the listed extensions enabled while
223
+ * everything else stays off). `paths` is a list of unpacked-extension directories. */
224
+ export declare function extensionArgs(paths?: string[]): string[];
225
+ /** First-run/UX hygiene switches for a DIRECT launch (`serve()` / `launchPlan()`).
226
+ *
227
+ * Playwright adds these itself on `launch()`, so a Playwright-driven browser never shows the
228
+ * first-run UI. A direct spawn gets none of that, and the ungoogled-chromium base then opens
229
+ * `chrome://ungoogled-first-run` ("ungoogled-chromium first run page", empty body) in the first
230
+ * tab whenever the caller passes no start URL, plus the default-browser prompt and the search
231
+ * engine choice screen in headed mode. These are plain UI switches, not `base::Feature` toggles:
232
+ * they change nothing a page can observe, so the identity layer (which owns
233
+ * `--enable-features`/`--disable-features`) is not affected and the coherence checker does not
234
+ * flag them. */
235
+ export declare const FIRST_RUN_HYGIENE_ARGS: readonly ["--no-first-run", "--no-default-browser-check", "--disable-search-engine-choice-screen"];
236
+ /** True when `args` carries a positional (non-switch) argument, which Chromium opens as a URL.
237
+ * Everything after a literal `--` is positional by Chromium's command-line rules. */
238
+ export declare function hasUrlPositional(args: readonly string[]): boolean;
239
+ /** The neutral start page for a direct launch with no caller URL: `about:blank` as the final
240
+ * positional, so the first tab is blank instead of the ungoogled first-run page. Empty when the
241
+ * caller already supplied a URL positional (Chromium would open both otherwise). */
242
+ export declare function defaultStartUrlArgs(args: readonly string[]): string[];
243
+ /** Message thrown for a SOCKS proxy descriptor that carries `username`/`password`. Exported so the
244
+ * tests and the Python SDK's mirror can assert on the same wording. */
245
+ export declare const SOCKS_CREDENTIALS_UNSUPPORTED: string;
246
+ /** Resolve a Playwright proxy descriptor into `{ args, proxy }`.
247
+ *
248
+ * Every proxy shape is left to Playwright unchanged, except a SOCKS proxy WITH credentials, which
249
+ * throws: neither Playwright (it rejects credentials in a SOCKS descriptor) nor the engine (stock
250
+ * Chromium has no RFC 1929 client, and no ant0-browser patch adds one) can authenticate to it, so
251
+ * a launch would silently produce a proxy that refuses every connection. Callers needing a
252
+ * credentialed SOCKS5 upstream run a local relay and hand the SDK its unauthenticated loopback
253
+ * address instead. Userinfo inside the URL (`socks5://user:pass@host:port`) counts as credentials
254
+ * too: Chromium would drop it silently. */
255
+ export declare function resolveProxy(proxy: PwProxy | undefined): {
256
+ args: string[];
257
+ proxy: PwProxy | undefined;
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;
266
+ //# sourceMappingURL=launchopts.d.ts.map
@@ -0,0 +1 @@
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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