extension 3.12.0 → 3.12.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 (101) hide show
  1. package/README.md +1 -1
  2. package/dist/728.cjs +1890 -0
  3. package/dist/browsers.cjs +4962 -0
  4. package/dist/cli.cjs +6621 -1684
  5. package/dist/extension/browsers/browsers-lib/banner.d.ts +37 -0
  6. package/dist/extension/browsers/browsers-lib/constants.d.ts +14 -0
  7. package/dist/extension/browsers/browsers-lib/content-script-contracts.d.ts +2 -0
  8. package/dist/extension/browsers/browsers-lib/content-script-targets.d.ts +33 -0
  9. package/dist/extension/browsers/browsers-lib/html-merge.d.ts +1 -0
  10. package/dist/extension/browsers/browsers-lib/instance-registry.d.ts +8 -0
  11. package/dist/extension/browsers/browsers-lib/messages.d.ts +208 -0
  12. package/dist/extension/browsers/browsers-lib/normalize-options.d.ts +12 -0
  13. package/dist/extension/browsers/browsers-lib/output-binaries-resolver.d.ts +5 -0
  14. package/dist/extension/browsers/browsers-lib/ready-message.d.ts +1 -0
  15. package/dist/extension/browsers/browsers-lib/runtime-options.d.ts +12 -0
  16. package/dist/extension/browsers/browsers-lib/shared-utils.d.ts +11 -0
  17. package/dist/extension/browsers/browsers-lib/source-output.d.ts +86 -0
  18. package/dist/extension/browsers/browsers-types.d.ts +270 -0
  19. package/dist/extension/browsers/index.d.ts +74 -0
  20. package/dist/extension/browsers/run-chromium/chromium-context/index.d.ts +20 -0
  21. package/dist/extension/browsers/run-chromium/chromium-launch/browser-config.d.ts +4 -0
  22. package/dist/extension/browsers/run-chromium/chromium-launch/dry-run.d.ts +1 -0
  23. package/dist/extension/browsers/run-chromium/chromium-launch/extension-output-path.d.ts +8 -0
  24. package/dist/extension/browsers/run-chromium/chromium-launch/index.d.ts +31 -0
  25. package/dist/extension/browsers/run-chromium/chromium-launch/master-preferences.d.ts +163 -0
  26. package/dist/extension/browsers/run-chromium/chromium-launch/process-handlers.d.ts +3 -0
  27. package/dist/extension/browsers/run-chromium/chromium-launch/setup-cdp-after-launch.d.ts +3 -0
  28. package/dist/extension/browsers/run-chromium/chromium-launch/wsl-support.d.ts +15 -0
  29. package/dist/extension/browsers/run-chromium/chromium-source-inspection/cdp-client.d.ts +60 -0
  30. package/dist/extension/browsers/run-chromium/chromium-source-inspection/cdp-extension-controller/connect.d.ts +2 -0
  31. package/dist/extension/browsers/run-chromium/chromium-source-inspection/cdp-extension-controller/derive-id.d.ts +2 -0
  32. package/dist/extension/browsers/run-chromium/chromium-source-inspection/cdp-extension-controller/ensure.d.ts +6 -0
  33. package/dist/extension/browsers/run-chromium/chromium-source-inspection/cdp-extension-controller/index.d.ts +58 -0
  34. package/dist/extension/browsers/run-chromium/chromium-source-inspection/cdp-extension-controller/logging.d.ts +7 -0
  35. package/dist/extension/browsers/run-chromium/chromium-source-inspection/deterministic-hmr-harness.d.ts +21 -0
  36. package/dist/extension/browsers/run-chromium/chromium-source-inspection/discovery.d.ts +2 -0
  37. package/dist/extension/browsers/run-chromium/chromium-source-inspection/extensions.d.ts +9 -0
  38. package/dist/extension/browsers/run-chromium/chromium-source-inspection/extract.d.ts +2 -0
  39. package/dist/extension/browsers/run-chromium/chromium-source-inspection/index.d.ts +79 -0
  40. package/dist/extension/browsers/run-chromium/chromium-source-inspection/page.d.ts +45 -0
  41. package/dist/extension/browsers/run-chromium/chromium-source-inspection/readiness.d.ts +1 -0
  42. package/dist/extension/browsers/run-chromium/chromium-source-inspection/sessions.d.ts +2 -0
  43. package/dist/extension/browsers/run-chromium/chromium-source-inspection/targets.d.ts +7 -0
  44. package/dist/extension/browsers/run-chromium/chromium-source-inspection/ws.d.ts +2 -0
  45. package/dist/extension/browsers/run-chromium/chromium-types.d.ts +65 -0
  46. package/dist/extension/browsers/run-chromium/chromium-unified-logger/index.d.ts +22 -0
  47. package/dist/extension/browsers/run-chromium/chromium-unified-logger/unified-logging.d.ts +2 -0
  48. package/dist/extension/browsers/run-chromium/manifest-readiness.d.ts +15 -0
  49. package/dist/extension/browsers/run-firefox/firefox-context/index.d.ts +24 -0
  50. package/dist/extension/browsers/run-firefox/firefox-launch/binary-detector.d.ts +10 -0
  51. package/dist/extension/browsers/run-firefox/firefox-launch/browser-config.d.ts +19 -0
  52. package/dist/extension/browsers/run-firefox/firefox-launch/dry-run.d.ts +1 -0
  53. package/dist/extension/browsers/run-firefox/firefox-launch/index.d.ts +37 -0
  54. package/dist/extension/browsers/run-firefox/firefox-launch/master-preferences.d.ts +137 -0
  55. package/dist/extension/browsers/run-firefox/firefox-launch/process-handlers.d.ts +2 -0
  56. package/dist/extension/browsers/run-firefox/firefox-launch/setup-rdp-after-launch.d.ts +6 -0
  57. package/dist/extension/browsers/run-firefox/firefox-launch/wsl-support.d.ts +15 -0
  58. package/dist/extension/browsers/run-firefox/firefox-source-inspection/index.d.ts +52 -0
  59. package/dist/extension/browsers/run-firefox/firefox-source-inspection/rdp-extension-controller/index.d.ts +38 -0
  60. package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/addons-install.d.ts +10 -0
  61. package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/addons.d.ts +1 -0
  62. package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/evaluate.d.ts +18 -0
  63. package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/firefox-utils.d.ts +17 -0
  64. package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/index.d.ts +38 -0
  65. package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/logging.d.ts +11 -0
  66. package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/message-utils.d.ts +2 -0
  67. package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/messaging-client.d.ts +42 -0
  68. package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/moz-id.d.ts +2 -0
  69. package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/rdp-api.d.ts +29 -0
  70. package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/rdp-wire.d.ts +8 -0
  71. package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/setup-firefox-inspection-actors.d.ts +5 -0
  72. package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/setup-firefox-inspection-navigation.d.ts +2 -0
  73. package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/source-inspect.d.ts +9 -0
  74. package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/transport.d.ts +20 -0
  75. package/dist/extension/browsers/run-firefox/firefox-types.d.ts +16 -0
  76. package/dist/extension/browsers/run-firefox/firefox-unified-logger/index.d.ts +14 -0
  77. package/dist/extension/browsers/run-only.d.ts +22 -0
  78. package/dist/extension/helpers/extension-develop-runtime.d.ts +9 -0
  79. package/dist/{utils.d.ts → extension/helpers/vendors.d.ts} +0 -1
  80. package/dist/extension/vitest.config.d.ts +2 -0
  81. package/package.json +19 -9
  82. package/dist/cli-lib/extension-develop-runtime.d.ts +0 -3
  83. /package/dist/{vitest.config.d.ts → extension/browsers/vitest.config.d.ts} +0 -0
  84. /package/dist/{commands → extension/commands}/build.d.ts +0 -0
  85. /package/dist/{commands → extension/commands}/create.d.ts +0 -0
  86. /package/dist/{commands → extension/commands}/dev-wait.d.ts +0 -0
  87. /package/dist/{commands → extension/commands}/dev.d.ts +0 -0
  88. /package/dist/{commands → extension/commands}/install.d.ts +0 -0
  89. /package/dist/{commands → extension/commands}/preview.d.ts +0 -0
  90. /package/dist/{commands → extension/commands}/start.d.ts +0 -0
  91. /package/dist/{check-updates.d.ts → extension/helpers/check-updates.d.ts} +0 -0
  92. /package/dist/{cli-package-json.d.ts → extension/helpers/cli-package-json.d.ts} +0 -0
  93. /package/dist/{cli-lib → extension/helpers}/manifest-summary.d.ts +0 -0
  94. /package/dist/{cli-lib → extension/helpers}/messages.d.ts +0 -0
  95. /package/dist/{utils → extension/helpers}/normalize-options.d.ts +0 -0
  96. /package/dist/{cli-lib → extension/helpers}/project-profile.d.ts +0 -0
  97. /package/dist/{cli-lib → extension/helpers}/telemetry-cli.d.ts +0 -0
  98. /package/dist/{cli-lib → extension/helpers}/telemetry.d.ts +0 -0
  99. /package/dist/{cli-lib → extension/helpers}/workflow-profile.d.ts +0 -0
  100. /package/dist/{index.d.ts → extension/index.d.ts} +0 -0
  101. /package/dist/{rslib.config.d.ts → extension/rslib.config.d.ts} +0 -0
@@ -0,0 +1,270 @@
1
+ export type BrowserType = 'chrome' | 'edge' | 'firefox' | 'chromium' | 'chromium-based' | 'gecko-based' | 'firefox-based';
2
+ /**
3
+ * Lightweight stand-in for rspack's Compilation used by browser-launching code.
4
+ * Only the properties actually read by launch/reload/inspection flows are declared.
5
+ */
6
+ export interface CompilationLike {
7
+ options: {
8
+ mode?: string;
9
+ output?: {
10
+ path?: string;
11
+ };
12
+ context?: string;
13
+ };
14
+ outputOptions?: {
15
+ path?: string;
16
+ };
17
+ getAsset?: (name: string) => {
18
+ source: {
19
+ source: () => string;
20
+ };
21
+ } | undefined;
22
+ }
23
+ /**
24
+ * Minimal logger interface mirroring the shape returned by
25
+ * rspack's `compiler.getInfrastructureLogger()`.
26
+ */
27
+ export interface BrowserLogger {
28
+ info: (...args: unknown[]) => void;
29
+ warn: (...args: unknown[]) => void;
30
+ error: (...args: unknown[]) => void;
31
+ debug: (...args: unknown[]) => void;
32
+ }
33
+ /**
34
+ * Stand-in for rspack's BrowserConfig — the subset used by browser-config helpers.
35
+ */
36
+ export interface BrowserConfig {
37
+ extensionPath: string;
38
+ profilePath: string | false;
39
+ preferences: Record<string, unknown>;
40
+ browserFlags: string[];
41
+ startingUrl: string | undefined;
42
+ }
43
+ /**
44
+ * List of default browser flags used by extension.js.
45
+ * These can be excluded using the `excludeBrowserFlags` option.
46
+ *
47
+ * Each flag disables or modifies a specific browser feature for a more controlled development environment.
48
+ */
49
+ export type DefaultBrowserFlags = '--no-first-run' | '--disable-client-side-phishing-detection' | '--disable-component-extensions-with-background-pages' | '--disable-default-apps' | '--disable-features=InterestFeedContentSuggestions' | '--disable-features=Translate' | '--hide-scrollbars' | '--mute-audio' | '--no-default-browser-check' | '--ash-no-nudges' | '--disable-search-engine-choice-screen' | '--disable-features=MediaRoute' | '--use-mock-keychain' | '--disable-background-networking' | '--disable-breakpad' | '--disable-component-update' | '--disable-domain-reliability' | '--disable-features=AutofillServerCommunicatio' | '--disable-features=CertificateTransparencyComponentUpdate' | '--disable-sync' | '--disable-features=OptimizationHints' | '--disable-features=DialMediaRouteProvider' | '--no-pings' | '--enable-features=SidePanelUpdates';
50
+ /**
51
+ * Options for the browser plugin.
52
+ */
53
+ export interface PluginOptions {
54
+ /**
55
+ * Do not open the browser automatically after launch.
56
+ * @default false
57
+ */
58
+ noOpen?: boolean;
59
+ /**
60
+ * Additional browser flags to pass to the browser process.
61
+ * Example: ['--disable-extensions', '--disable-gpu']
62
+ */
63
+ browserFlags?: string[];
64
+ /**
65
+ * Array of browser flags to exclude from the default set.
66
+ * Example: ['--hide-scrollbars', '--mute-audio']
67
+ */
68
+ excludeBrowserFlags?: Array<DefaultBrowserFlags | string>;
69
+ /**
70
+ * Path to the browser profile directory, or false for a temporary profile.
71
+ * Example: 'dist/extension' or false
72
+ */
73
+ profile?: string | false;
74
+ /**
75
+ * Use a persistent managed profile for development.
76
+ * Defaults to false (ephemeral temp profiles are used).
77
+ */
78
+ persistProfile?: boolean;
79
+ /**
80
+ * Browser preferences object.
81
+ * Example: { extensions: ['dist/extension', 'dist/extension2'] }
82
+ */
83
+ preferences?: Record<string, unknown>;
84
+ /**
85
+ * Firefox only: persist changes made to the profile directory.
86
+ */
87
+ keepProfileChanges?: boolean;
88
+ /**
89
+ * Firefox only: copy an existing profile before launching.
90
+ */
91
+ copyFromProfile?: string;
92
+ /**
93
+ * URL to open when the browser starts.
94
+ * Example: 'http://localhost:3000'
95
+ */
96
+ startingUrl?: string;
97
+ /**
98
+ * Enable the browser console.
99
+ * @default false
100
+ */
101
+ browserConsole?: boolean;
102
+ /**
103
+ * Open DevTools automatically.
104
+ * @default false
105
+ */
106
+ devtools?: boolean;
107
+ /**
108
+ * Path to the Chromium binary.
109
+ * Example: '/path/to/chromium'
110
+ */
111
+ chromiumBinary?: string;
112
+ /**
113
+ * Path to the Gecko (Firefox) binary.
114
+ * Example: '/path/to/gecko'
115
+ */
116
+ geckoBinary?: string;
117
+ }
118
+ /**
119
+ * Main interface for the browser plugin.
120
+ */
121
+ export interface PluginInterface extends PluginOptions {
122
+ /**
123
+ * Browser type to launch.
124
+ * @default 'chrome'
125
+ * @see DevOptions['browser']
126
+ * Example: 'chrome' | 'edge' | 'firefox'
127
+ */
128
+ browser: BrowserType;
129
+ /**
130
+ * Path(s) to the extension(s) to load.
131
+ * Example: 'dist/extension' or ['dist/extension', 'dist/extension2']
132
+ */
133
+ extension: string | string[];
134
+ /**
135
+ * Port to use for the extension or debugging.
136
+ * Example: 12345 or '12345'
137
+ */
138
+ port?: string | number;
139
+ /**
140
+ * Internal auto-generated instance ID (not user-configurable).
141
+ * Example: '1234567890'
142
+ */
143
+ instanceId?: string;
144
+ /**
145
+ * Path to source files for inspection.
146
+ * Example: 'dist/extension'
147
+ */
148
+ source?: string;
149
+ /**
150
+ * Whether to watch the source directory for changes.
151
+ * @default false
152
+ */
153
+ watchSource?: boolean;
154
+ /**
155
+ * Output format for source inspection HTML.
156
+ */
157
+ sourceFormat?: 'pretty' | 'json' | 'ndjson';
158
+ /**
159
+ * Output a compact summary instead of full HTML.
160
+ * @default false
161
+ */
162
+ sourceSummary?: boolean;
163
+ /**
164
+ * Output page metadata (readyState, viewport, frames).
165
+ */
166
+ sourceMeta?: boolean;
167
+ /**
168
+ * CSS selectors to probe for debugging.
169
+ */
170
+ sourceProbe?: string[];
171
+ /**
172
+ * Output a compact extension root tree.
173
+ */
174
+ sourceTree?: 'off' | 'root-only';
175
+ /**
176
+ * Output console summary (best-effort).
177
+ */
178
+ sourceConsole?: boolean;
179
+ /**
180
+ * Output DOM snapshots and diffs.
181
+ */
182
+ sourceDom?: boolean;
183
+ /**
184
+ * Maximum HTML bytes to print (0 disables truncation).
185
+ */
186
+ sourceMaxBytes?: number;
187
+ /**
188
+ * Redaction mode for HTML output.
189
+ */
190
+ sourceRedact?: 'off' | 'safe' | 'strict';
191
+ /**
192
+ * Control Shadow DOM inclusion when extracting HTML.
193
+ */
194
+ sourceIncludeShadow?: 'off' | 'open-only' | 'all';
195
+ /**
196
+ * Include diff metadata on watch updates.
197
+ */
198
+ sourceDiff?: boolean;
199
+ /**
200
+ * Log level for unified logger (Chromium CDP logging).
201
+ * One of: 'off', 'error', 'warn', 'info', 'debug', 'trace', 'all'
202
+ */
203
+ logLevel?: 'off' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'all';
204
+ /**
205
+ * Log contexts to enable.
206
+ * Example: ['background', 'content', 'page']
207
+ */
208
+ logContexts?: Array<'background' | 'content' | 'page' | 'sidebar' | 'popup' | 'options' | 'devtools'>;
209
+ /**
210
+ * Log output format.
211
+ * One of: 'pretty', 'json'
212
+ */
213
+ logFormat?: 'pretty' | 'json' | 'ndjson';
214
+ /**
215
+ * Include timestamps in logs.
216
+ * @default true
217
+ */
218
+ logTimestamps?: boolean;
219
+ /**
220
+ * Enable colored log output.
221
+ * @default false
222
+ */
223
+ logColor?: boolean;
224
+ /**
225
+ * URL to send logs to.
226
+ * Example: 'http://localhost:3000'
227
+ */
228
+ logUrl?: string;
229
+ /**
230
+ * Tab ID or index for logging context.
231
+ */
232
+ logTab?: number | string;
233
+ /**
234
+ * Perform a dry run without launching the browser.
235
+ * @default false
236
+ */
237
+ dryRun?: boolean;
238
+ }
239
+ /**
240
+ * Runtime state shared with post-launch setup helpers (CDP/RDP).
241
+ * Extends the main PluginInterface with transient fields used during runtime.
242
+ */
243
+ export interface PluginRuntime extends PluginInterface {
244
+ }
245
+ export type LogLevel = 'off' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'all';
246
+ export type LogContext = 'background' | 'content' | 'page' | 'sidebar' | 'popup' | 'options' | 'devtools';
247
+ export type LogFormat = 'pretty' | 'json' | 'ndjson';
248
+ /**
249
+ * Unified controller interface used by post-launch logging flows.
250
+ * Implemented by both CDP and RDP controllers.
251
+ */
252
+ export interface Controller {
253
+ enableUnifiedLogging: (opts: {
254
+ level?: string;
255
+ contexts?: string[] | undefined;
256
+ urlFilter?: string | undefined;
257
+ tabFilter?: number | string | undefined;
258
+ format?: 'pretty' | 'json' | 'ndjson';
259
+ timestamps?: boolean;
260
+ color?: boolean;
261
+ }) => Promise<void>;
262
+ /**
263
+ * Optional event subscription hook for protocol events (CDP/RDP).
264
+ * Present in Chromium CDP flows; Firefox may omit it.
265
+ */
266
+ onProtocolEvent?: (cb: (evt: {
267
+ method?: string;
268
+ params?: unknown;
269
+ }) => void) => void;
270
+ }
@@ -0,0 +1,74 @@
1
+ import type { BrowserType } from './browsers-types';
2
+ export type { BrowserType, CompilationLike, Controller } from './browsers-types';
3
+ /**
4
+ * Options for launching a browser with an extension loaded.
5
+ */
6
+ export interface BrowserLaunchOptions {
7
+ browser: BrowserType;
8
+ outputPath: string;
9
+ contextDir: string;
10
+ extensionsToLoad: string[];
11
+ mode?: 'development' | 'production';
12
+ enableDevtools?: boolean;
13
+ noOpen?: boolean;
14
+ profile?: string | false;
15
+ persistProfile?: boolean;
16
+ preferences?: Record<string, unknown>;
17
+ browserFlags?: string[];
18
+ excludeBrowserFlags?: string[];
19
+ startingUrl?: string;
20
+ chromiumBinary?: string;
21
+ geckoBinary?: string;
22
+ instanceId?: string;
23
+ port?: number | string;
24
+ dryRun?: boolean;
25
+ source?: string;
26
+ watchSource?: boolean;
27
+ sourceFormat?: 'pretty' | 'json' | 'ndjson';
28
+ sourceSummary?: boolean;
29
+ sourceMeta?: boolean;
30
+ sourceProbe?: string[];
31
+ sourceTree?: 'off' | 'root-only';
32
+ sourceConsole?: boolean;
33
+ sourceDom?: boolean;
34
+ sourceMaxBytes?: number;
35
+ sourceRedact?: 'off' | 'safe' | 'strict';
36
+ sourceIncludeShadow?: 'off' | 'open-only' | 'all';
37
+ sourceDiff?: boolean;
38
+ logLevel?: string;
39
+ logContexts?: string[];
40
+ logFormat?: 'pretty' | 'json' | 'ndjson';
41
+ logTimestamps?: boolean;
42
+ logColor?: boolean;
43
+ logUrl?: string;
44
+ logTab?: number | string;
45
+ }
46
+ /**
47
+ * Handle returned by `launchBrowser` — provides reload and logging control.
48
+ */
49
+ export interface BrowserController {
50
+ reload(instruction?: {
51
+ type: 'full' | 'service-worker' | 'content-scripts';
52
+ changedContentScriptEntries?: string[];
53
+ changedAssets?: string[];
54
+ }): Promise<void>;
55
+ enableUnifiedLogging(opts: {
56
+ level?: string;
57
+ contexts?: string[];
58
+ format?: 'pretty' | 'json' | 'ndjson';
59
+ timestamps?: boolean;
60
+ color?: boolean;
61
+ urlFilter?: string;
62
+ tabFilter?: number | string;
63
+ }): Promise<void>;
64
+ close(): Promise<void>;
65
+ }
66
+ /**
67
+ * Launch a browser with the given extension(s) loaded.
68
+ *
69
+ * Returns a `BrowserController` that provides reload and unified-logging control.
70
+ * This is the primary entry point for the CLI orchestration layer — it replaces
71
+ * the old BrowsersPlugin that lived inside the bundler.
72
+ */
73
+ export declare function launchBrowser(opts: BrowserLaunchOptions): Promise<BrowserController>;
74
+ export { runOnlyPreviewBrowser } from './run-only';
@@ -0,0 +1,20 @@
1
+ import type { CDPExtensionController } from '../chromium-source-inspection/cdp-extension-controller';
2
+ export type ChromiumContext = {
3
+ getController(): CDPExtensionController | undefined;
4
+ onControllerReady(cb: (c: CDPExtensionController, port: number) => void): void;
5
+ setController(c: CDPExtensionController, port: number): void;
6
+ getPorts(): {
7
+ cdpPort?: number;
8
+ };
9
+ getExtensionRoot(): string | undefined;
10
+ setExtensionRoot(root?: string): void;
11
+ setServiceWorkerPaths(rel?: string, abs?: string): void;
12
+ getServiceWorkerPaths(): {
13
+ relativePath?: string;
14
+ absolutePath?: string;
15
+ };
16
+ setPendingReloadReason(reason?: 'manifest' | 'locales' | 'sw'): void;
17
+ getPendingReloadReason(): 'manifest' | 'locales' | 'sw' | undefined;
18
+ clearPendingReloadReason(): void;
19
+ };
20
+ export declare function createChromiumContext(): ChromiumContext;
@@ -0,0 +1,4 @@
1
+ import { type CompilationLike } from '../../browsers-types';
2
+ import { type PluginInterface, type DefaultBrowserFlags } from '../../browsers-types';
3
+ export declare const DEFAULT_BROWSER_FLAGS: DefaultBrowserFlags[];
4
+ export declare function browserConfig(compilation: CompilationLike, configOptions: PluginInterface): string[];
@@ -0,0 +1 @@
1
+ export declare function logChromiumDryRun(browserBinaryLocation: string, chromiumConfig: string[]): void;
@@ -0,0 +1,8 @@
1
+ import type { CompilationLike } from '../../browsers-types';
2
+ /**
3
+ * Derive the user extension output path from `--load-extension=...` flags.
4
+ *
5
+ * Kept in a standalone module so run-only preview can reuse it without
6
+ * importing CDP/WS-related code paths.
7
+ */
8
+ export declare function getExtensionOutputPath(compilation: CompilationLike | undefined, loadExtensionFlag: string | undefined): string;
@@ -0,0 +1,31 @@
1
+ import type { CompilationLike } from '../../browsers-types';
2
+ import type { ChromiumContext } from '../chromium-context';
3
+ import type { ChromiumLaunchOptions } from '../chromium-types';
4
+ /**
5
+ * ChromiumLaunchPlugin
6
+ *
7
+ * Intended responsibilities (will be wired incrementally without changing inner logic):
8
+ * - Resolve binary; compose flags (profiles, excludes, overrides)
9
+ * - Allocate CDP port; spawn process; setup signals; dry-run
10
+ * - Connect CDP; ensure extension loaded; print dev banner
11
+ * - Publish controller + port via ChromiumContext
12
+ */
13
+ export declare class ChromiumLaunchPlugin {
14
+ private readonly options;
15
+ private readonly ctx;
16
+ private didLaunch;
17
+ private didReportReady;
18
+ private logger;
19
+ constructor(options: ChromiumLaunchOptions, ctx: ChromiumContext);
20
+ /**
21
+ * Run the Chromium launch flow without requiring a bundler compiler instance.
22
+ * Intended for run-only preview paths.
23
+ */
24
+ runOnce(compilation: CompilationLike, opts?: {
25
+ enableCdpPostLaunch?: boolean;
26
+ }): Promise<void>;
27
+ apply(compiler: any): void;
28
+ private launchChromium;
29
+ private launchWithDirectSpawn;
30
+ private printEnhancedPuppeteerInstallHint;
31
+ }
@@ -0,0 +1,163 @@
1
+ declare const chromeMasterPreferences: {
2
+ alternate_error_pages: {
3
+ enabled: boolean;
4
+ };
5
+ autofill: {
6
+ enabled: boolean;
7
+ };
8
+ browser: {
9
+ check_default_browser: boolean;
10
+ default_browser_setting_enabled: boolean;
11
+ };
12
+ default_apps: string;
13
+ distribution: {
14
+ alternate_shortcut_text: boolean;
15
+ auto_launch_chrome: boolean;
16
+ import_bookmarks: boolean;
17
+ import_history: boolean;
18
+ import_home_page: boolean;
19
+ import_search_engine: boolean;
20
+ suppress_first_run_bubble: boolean;
21
+ do_not_register_for_update_launch: boolean;
22
+ make_chrome_default: boolean;
23
+ make_chrome_default_for_user: boolean;
24
+ require_eula: boolean;
25
+ suppress_first_run_default_browser_prompt: boolean;
26
+ };
27
+ dns_prefetching: {
28
+ enabled: boolean;
29
+ };
30
+ download: {
31
+ default_directory: string;
32
+ directory_upgrade: boolean;
33
+ open_pdf_in_adobe_reader: boolean;
34
+ prompt_for_download: boolean;
35
+ };
36
+ enable_do_not_track: boolean;
37
+ extensions: {
38
+ theme: {
39
+ use_system: boolean;
40
+ };
41
+ toolbarsize: number;
42
+ developer_mode: boolean;
43
+ ui: {
44
+ developer_mode: boolean;
45
+ };
46
+ };
47
+ plugins: {
48
+ plugins_list: {
49
+ enabled: boolean;
50
+ name: string;
51
+ }[];
52
+ show_details: boolean;
53
+ };
54
+ profile: {
55
+ password_manager_enabled: boolean;
56
+ };
57
+ safebrowsing: {
58
+ enabled: boolean;
59
+ safebrowsingextended_reporting_enabled: boolean;
60
+ };
61
+ savefile: {
62
+ default_directory: string;
63
+ type: number;
64
+ };
65
+ search: {
66
+ suggest_enabled: boolean;
67
+ };
68
+ session: {
69
+ restore_on_startup: number;
70
+ };
71
+ sync: {
72
+ suppress_start: boolean;
73
+ };
74
+ sync_promo: {
75
+ show_on_first_run_allowed: boolean;
76
+ show_ntp_bubble: boolean;
77
+ };
78
+ translate: {
79
+ enabled: boolean;
80
+ };
81
+ };
82
+ declare const edgeMasterPreferences: {
83
+ alternate_error_pages: {
84
+ enabled: boolean;
85
+ };
86
+ autofill: {
87
+ enabled: boolean;
88
+ };
89
+ browser: {
90
+ check_default_browser: boolean;
91
+ default_browser_setting_enabled: boolean;
92
+ };
93
+ default_apps: string;
94
+ distribution: {
95
+ alternate_shortcut_text: boolean;
96
+ auto_launch_chrome: boolean;
97
+ import_bookmarks: boolean;
98
+ import_history: boolean;
99
+ import_home_page: boolean;
100
+ import_search_engine: boolean;
101
+ suppress_first_run_bubble: boolean;
102
+ do_not_register_for_update_launch: boolean;
103
+ make_chrome_default: boolean;
104
+ make_chrome_default_for_user: boolean;
105
+ require_eula: boolean;
106
+ suppress_first_run_default_browser_prompt: boolean;
107
+ };
108
+ dns_prefetching: {
109
+ enabled: boolean;
110
+ };
111
+ download: {
112
+ default_directory: string;
113
+ directory_upgrade: boolean;
114
+ open_pdf_in_adobe_reader: boolean;
115
+ prompt_for_download: boolean;
116
+ };
117
+ enable_do_not_track: boolean;
118
+ extensions: {
119
+ theme: {
120
+ use_system: boolean;
121
+ };
122
+ toolbarsize: number;
123
+ developer_mode: boolean;
124
+ ui: {
125
+ developer_mode: boolean;
126
+ };
127
+ };
128
+ plugins: {
129
+ plugins_list: {
130
+ enabled: boolean;
131
+ name: string;
132
+ }[];
133
+ show_details: boolean;
134
+ };
135
+ profile: {
136
+ password_manager_enabled: boolean;
137
+ };
138
+ safebrowsing: {
139
+ enabled: boolean;
140
+ safebrowsingextended_reporting_enabled: boolean;
141
+ };
142
+ savefile: {
143
+ default_directory: string;
144
+ type: number;
145
+ };
146
+ search: {
147
+ suggest_enabled: boolean;
148
+ };
149
+ session: {
150
+ restore_on_startup: number;
151
+ };
152
+ sync: {
153
+ suppress_start: boolean;
154
+ };
155
+ sync_promo: {
156
+ show_on_first_run_allowed: boolean;
157
+ show_ntp_bubble: boolean;
158
+ };
159
+ translate: {
160
+ enabled: boolean;
161
+ };
162
+ };
163
+ export { chromeMasterPreferences, edgeMasterPreferences };
@@ -0,0 +1,3 @@
1
+ import { ChildProcess } from 'child_process';
2
+ import type { BrowserType } from '../../browsers-types';
3
+ export declare function setupProcessSignalHandlers(browser: BrowserType, child: ChildProcess, cleanupInstance: () => void): void;
@@ -0,0 +1,3 @@
1
+ import type { CompilationLike } from '../../browsers-types';
2
+ import { type ChromiumPluginRuntime } from '../chromium-types';
3
+ export declare function setupCdpAfterLaunch(compilation: CompilationLike | undefined, plugin: ChromiumPluginRuntime, chromiumArgs: string[]): Promise<void>;
@@ -0,0 +1,15 @@
1
+ import { ChildProcess } from 'child_process';
2
+ type ChromiumLogger = {
3
+ warn?: (...args: unknown[]) => void;
4
+ };
5
+ export declare function isWslEnv(): boolean;
6
+ export declare function normalizeBinaryPathForWsl(input: string): string;
7
+ export declare function resolveWslWindowsBinary(browser: string): string | null;
8
+ export declare function spawnChromiumProcess(opts: {
9
+ binary: string;
10
+ launchArgs: string[];
11
+ stdio: 'ignore';
12
+ browser: string;
13
+ logger?: ChromiumLogger;
14
+ }): Promise<ChildProcess>;
15
+ export {};
@@ -0,0 +1,60 @@
1
+ import { type ExtensionRootMetaPayload } from './page';
2
+ export declare class CDPClient {
3
+ private port;
4
+ private host;
5
+ private ws;
6
+ private targetWebSocketUrl;
7
+ private eventCallbacks;
8
+ private messageId;
9
+ private pendingRequests;
10
+ private heartbeatTimer;
11
+ constructor(port?: number, host?: string);
12
+ private isDev;
13
+ connect(): Promise<void>;
14
+ disconnect(): void;
15
+ private startHeartbeat;
16
+ private stopHeartbeat;
17
+ isConnected(): boolean;
18
+ onProtocolEvent(handler: (message: Record<string, unknown>) => void): () => void;
19
+ private handleMessage;
20
+ sendCommand(method: string, params?: Record<string, unknown>, sessionId?: string, timeoutMs?: number): Promise<unknown>;
21
+ getTargets(): Promise<Record<string, unknown>[]>;
22
+ getBrowserVersion(): Promise<{
23
+ product?: string;
24
+ userAgent?: string;
25
+ jsVersion?: string;
26
+ }>;
27
+ attachToTarget(targetId: string): Promise<string>;
28
+ enableAutoAttach(): Promise<void>;
29
+ enableRuntimeAndLog(sessionId?: string): Promise<void>;
30
+ navigate(sessionId: string, url: string): Promise<void>;
31
+ createTarget(url: string): Promise<string>;
32
+ activateTarget(targetId: string): Promise<void>;
33
+ waitForLoadEvent(sessionId: string): Promise<void>;
34
+ waitForContentScriptInjection(sessionId: string): Promise<boolean>;
35
+ /** Extension root / reinject markers — uses page + isolated content-script context (matches injection wait). */
36
+ getExtensionRootMeta(sessionId: string): Promise<ExtensionRootMetaPayload | undefined>;
37
+ /** Shadow <style> nodes under non-devtools content roots — same dual-context evaluation as root meta. */
38
+ getShadowStyleSnapshot(sessionId: string): Promise<Record<string, unknown> | undefined>;
39
+ /** Best-effort poll when injection wait fails (async shadow fill, context quirks). */
40
+ pollForVisibleShadowHostContent(sessionId: string, deadlineMs?: number): Promise<void>;
41
+ hasVisibleShadowHostContent(sessionId: string): Promise<boolean>;
42
+ evaluate(sessionId: string, expression: string, options?: {
43
+ awaitPromise?: boolean;
44
+ }): Promise<unknown>;
45
+ evaluateInContext(sessionId: string, expression: string, contextId: number, options?: {
46
+ awaitPromise?: boolean;
47
+ }): Promise<unknown>;
48
+ getPageHTML(sessionId: string, includeShadow?: 'off' | 'open-only' | 'all'): Promise<string>;
49
+ closeTarget(targetId: string): Promise<void>;
50
+ forceReloadExtension(extensionId: string): Promise<boolean>;
51
+ getExtensionInfo(extensionId: string): Promise<{
52
+ extensionInfo?: {
53
+ name?: string;
54
+ version?: string;
55
+ };
56
+ }>;
57
+ private reloadExtensionViaTargetEval;
58
+ loadUnpackedExtension(path: string): Promise<string>;
59
+ unloadExtension(extensionId: string): Promise<boolean>;
60
+ }
@@ -0,0 +1,2 @@
1
+ import { CDPClient } from '../cdp-client';
2
+ export declare function connectToChromeCdp(cdpPort: number): Promise<CDPClient>;
@@ -0,0 +1,2 @@
1
+ import { CDPClient } from '../cdp-client';
2
+ export declare function deriveExtensionIdFromTargetsHelper(cdp: CDPClient, outPath: string, maxRetries?: number, backoffMs?: number, profilePath?: string, extensionPaths?: string[]): Promise<string | null>;
@@ -0,0 +1,6 @@
1
+ import { CDPClient } from '../cdp-client';
2
+ export declare function loadUnpackedIfNeeded(cdp: CDPClient, outPath: string): Promise<string | null>;
3
+ export declare function readManifestInfo(outPath: string): {
4
+ name?: string;
5
+ version?: string;
6
+ } | null;