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.
- package/README.md +1 -1
- package/dist/728.cjs +1890 -0
- package/dist/browsers.cjs +4962 -0
- package/dist/cli.cjs +6621 -1684
- package/dist/extension/browsers/browsers-lib/banner.d.ts +37 -0
- package/dist/extension/browsers/browsers-lib/constants.d.ts +14 -0
- package/dist/extension/browsers/browsers-lib/content-script-contracts.d.ts +2 -0
- package/dist/extension/browsers/browsers-lib/content-script-targets.d.ts +33 -0
- package/dist/extension/browsers/browsers-lib/html-merge.d.ts +1 -0
- package/dist/extension/browsers/browsers-lib/instance-registry.d.ts +8 -0
- package/dist/extension/browsers/browsers-lib/messages.d.ts +208 -0
- package/dist/extension/browsers/browsers-lib/normalize-options.d.ts +12 -0
- package/dist/extension/browsers/browsers-lib/output-binaries-resolver.d.ts +5 -0
- package/dist/extension/browsers/browsers-lib/ready-message.d.ts +1 -0
- package/dist/extension/browsers/browsers-lib/runtime-options.d.ts +12 -0
- package/dist/extension/browsers/browsers-lib/shared-utils.d.ts +11 -0
- package/dist/extension/browsers/browsers-lib/source-output.d.ts +86 -0
- package/dist/extension/browsers/browsers-types.d.ts +270 -0
- package/dist/extension/browsers/index.d.ts +74 -0
- package/dist/extension/browsers/run-chromium/chromium-context/index.d.ts +20 -0
- package/dist/extension/browsers/run-chromium/chromium-launch/browser-config.d.ts +4 -0
- package/dist/extension/browsers/run-chromium/chromium-launch/dry-run.d.ts +1 -0
- package/dist/extension/browsers/run-chromium/chromium-launch/extension-output-path.d.ts +8 -0
- package/dist/extension/browsers/run-chromium/chromium-launch/index.d.ts +31 -0
- package/dist/extension/browsers/run-chromium/chromium-launch/master-preferences.d.ts +163 -0
- package/dist/extension/browsers/run-chromium/chromium-launch/process-handlers.d.ts +3 -0
- package/dist/extension/browsers/run-chromium/chromium-launch/setup-cdp-after-launch.d.ts +3 -0
- package/dist/extension/browsers/run-chromium/chromium-launch/wsl-support.d.ts +15 -0
- package/dist/extension/browsers/run-chromium/chromium-source-inspection/cdp-client.d.ts +60 -0
- package/dist/extension/browsers/run-chromium/chromium-source-inspection/cdp-extension-controller/connect.d.ts +2 -0
- package/dist/extension/browsers/run-chromium/chromium-source-inspection/cdp-extension-controller/derive-id.d.ts +2 -0
- package/dist/extension/browsers/run-chromium/chromium-source-inspection/cdp-extension-controller/ensure.d.ts +6 -0
- package/dist/extension/browsers/run-chromium/chromium-source-inspection/cdp-extension-controller/index.d.ts +58 -0
- package/dist/extension/browsers/run-chromium/chromium-source-inspection/cdp-extension-controller/logging.d.ts +7 -0
- package/dist/extension/browsers/run-chromium/chromium-source-inspection/deterministic-hmr-harness.d.ts +21 -0
- package/dist/extension/browsers/run-chromium/chromium-source-inspection/discovery.d.ts +2 -0
- package/dist/extension/browsers/run-chromium/chromium-source-inspection/extensions.d.ts +9 -0
- package/dist/extension/browsers/run-chromium/chromium-source-inspection/extract.d.ts +2 -0
- package/dist/extension/browsers/run-chromium/chromium-source-inspection/index.d.ts +79 -0
- package/dist/extension/browsers/run-chromium/chromium-source-inspection/page.d.ts +45 -0
- package/dist/extension/browsers/run-chromium/chromium-source-inspection/readiness.d.ts +1 -0
- package/dist/extension/browsers/run-chromium/chromium-source-inspection/sessions.d.ts +2 -0
- package/dist/extension/browsers/run-chromium/chromium-source-inspection/targets.d.ts +7 -0
- package/dist/extension/browsers/run-chromium/chromium-source-inspection/ws.d.ts +2 -0
- package/dist/extension/browsers/run-chromium/chromium-types.d.ts +65 -0
- package/dist/extension/browsers/run-chromium/chromium-unified-logger/index.d.ts +22 -0
- package/dist/extension/browsers/run-chromium/chromium-unified-logger/unified-logging.d.ts +2 -0
- package/dist/extension/browsers/run-chromium/manifest-readiness.d.ts +15 -0
- package/dist/extension/browsers/run-firefox/firefox-context/index.d.ts +24 -0
- package/dist/extension/browsers/run-firefox/firefox-launch/binary-detector.d.ts +10 -0
- package/dist/extension/browsers/run-firefox/firefox-launch/browser-config.d.ts +19 -0
- package/dist/extension/browsers/run-firefox/firefox-launch/dry-run.d.ts +1 -0
- package/dist/extension/browsers/run-firefox/firefox-launch/index.d.ts +37 -0
- package/dist/extension/browsers/run-firefox/firefox-launch/master-preferences.d.ts +137 -0
- package/dist/extension/browsers/run-firefox/firefox-launch/process-handlers.d.ts +2 -0
- package/dist/extension/browsers/run-firefox/firefox-launch/setup-rdp-after-launch.d.ts +6 -0
- package/dist/extension/browsers/run-firefox/firefox-launch/wsl-support.d.ts +15 -0
- package/dist/extension/browsers/run-firefox/firefox-source-inspection/index.d.ts +52 -0
- package/dist/extension/browsers/run-firefox/firefox-source-inspection/rdp-extension-controller/index.d.ts +38 -0
- package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/addons-install.d.ts +10 -0
- package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/addons.d.ts +1 -0
- package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/evaluate.d.ts +18 -0
- package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/firefox-utils.d.ts +17 -0
- package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/index.d.ts +38 -0
- package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/logging.d.ts +11 -0
- package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/message-utils.d.ts +2 -0
- package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/messaging-client.d.ts +42 -0
- package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/moz-id.d.ts +2 -0
- package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/rdp-api.d.ts +29 -0
- package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/rdp-wire.d.ts +8 -0
- package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/setup-firefox-inspection-actors.d.ts +5 -0
- package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/setup-firefox-inspection-navigation.d.ts +2 -0
- package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/source-inspect.d.ts +9 -0
- package/dist/extension/browsers/run-firefox/firefox-source-inspection/remote-firefox/transport.d.ts +20 -0
- package/dist/extension/browsers/run-firefox/firefox-types.d.ts +16 -0
- package/dist/extension/browsers/run-firefox/firefox-unified-logger/index.d.ts +14 -0
- package/dist/extension/browsers/run-only.d.ts +22 -0
- package/dist/extension/helpers/extension-develop-runtime.d.ts +9 -0
- package/dist/{utils.d.ts → extension/helpers/vendors.d.ts} +0 -1
- package/dist/extension/vitest.config.d.ts +2 -0
- package/package.json +19 -9
- package/dist/cli-lib/extension-develop-runtime.d.ts +0 -3
- /package/dist/{vitest.config.d.ts → extension/browsers/vitest.config.d.ts} +0 -0
- /package/dist/{commands → extension/commands}/build.d.ts +0 -0
- /package/dist/{commands → extension/commands}/create.d.ts +0 -0
- /package/dist/{commands → extension/commands}/dev-wait.d.ts +0 -0
- /package/dist/{commands → extension/commands}/dev.d.ts +0 -0
- /package/dist/{commands → extension/commands}/install.d.ts +0 -0
- /package/dist/{commands → extension/commands}/preview.d.ts +0 -0
- /package/dist/{commands → extension/commands}/start.d.ts +0 -0
- /package/dist/{check-updates.d.ts → extension/helpers/check-updates.d.ts} +0 -0
- /package/dist/{cli-package-json.d.ts → extension/helpers/cli-package-json.d.ts} +0 -0
- /package/dist/{cli-lib → extension/helpers}/manifest-summary.d.ts +0 -0
- /package/dist/{cli-lib → extension/helpers}/messages.d.ts +0 -0
- /package/dist/{utils → extension/helpers}/normalize-options.d.ts +0 -0
- /package/dist/{cli-lib → extension/helpers}/project-profile.d.ts +0 -0
- /package/dist/{cli-lib → extension/helpers}/telemetry-cli.d.ts +0 -0
- /package/dist/{cli-lib → extension/helpers}/telemetry.d.ts +0 -0
- /package/dist/{cli-lib → extension/helpers}/workflow-profile.d.ts +0 -0
- /package/dist/{index.d.ts → extension/index.d.ts} +0 -0
- /package/dist/{rslib.config.d.ts → extension/rslib.config.d.ts} +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type ContentScriptTargetRule } from '../../../browsers-lib/content-script-targets';
|
|
2
|
+
interface ExtensionInfoResult {
|
|
3
|
+
extensionId: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
version?: string;
|
|
6
|
+
}
|
|
7
|
+
export type ChromiumDeveloperModeStatus = 'enabled' | 'disabled' | 'unknown';
|
|
8
|
+
export declare class CDPExtensionController {
|
|
9
|
+
private readonly outPath;
|
|
10
|
+
private readonly browser;
|
|
11
|
+
private readonly cdpPort;
|
|
12
|
+
private readonly profilePath?;
|
|
13
|
+
private readonly extensionPaths?;
|
|
14
|
+
private cdp;
|
|
15
|
+
private extensionId;
|
|
16
|
+
private lastRuntimeReinjectionReport;
|
|
17
|
+
constructor(args: {
|
|
18
|
+
outPath: string;
|
|
19
|
+
browser: 'chrome' | 'edge' | 'chromium-based';
|
|
20
|
+
cdpPort: number;
|
|
21
|
+
profilePath?: string;
|
|
22
|
+
extensionPaths?: string[];
|
|
23
|
+
});
|
|
24
|
+
connect(): Promise<void>;
|
|
25
|
+
ensureLoaded(): Promise<ExtensionInfoResult>;
|
|
26
|
+
private deriveExtensionIdFromTargets;
|
|
27
|
+
private normalizePath;
|
|
28
|
+
private extensionIdBelongsToOutPath;
|
|
29
|
+
getDeveloperModeStatus(): ChromiumDeveloperModeStatus;
|
|
30
|
+
getLastRuntimeReinjectionReport(): Record<string, unknown> | null;
|
|
31
|
+
reloadMatchingTabsForContentScripts(rules: ContentScriptTargetRule[], options?: {
|
|
32
|
+
preferPageReload?: boolean;
|
|
33
|
+
allowCoarseCleanup?: boolean;
|
|
34
|
+
sourceOverridesByBundleId?: Record<string, string>;
|
|
35
|
+
}): Promise<number>;
|
|
36
|
+
reinjectMatchingTabsViaExtensionRuntime(rules: ContentScriptTargetRule[]): Promise<number>;
|
|
37
|
+
private reloadPageTarget;
|
|
38
|
+
hardReload(): Promise<boolean>;
|
|
39
|
+
private attachToExtensionRuntimeTarget;
|
|
40
|
+
private connectFreshClient;
|
|
41
|
+
private reconnectForReload;
|
|
42
|
+
onProtocolEvent(cb: (evt: {
|
|
43
|
+
method: string;
|
|
44
|
+
params?: unknown;
|
|
45
|
+
} & Record<string, unknown>) => void): void;
|
|
46
|
+
clearProtocolEventHandler(): void;
|
|
47
|
+
enableUnifiedLogging(): Promise<void>;
|
|
48
|
+
enableRuntimeForSession(sessionId: string): Promise<void>;
|
|
49
|
+
private enableLogging;
|
|
50
|
+
getInfoBestEffort(): Promise<ExtensionInfoResult | null>;
|
|
51
|
+
private reinjectContentScriptRule;
|
|
52
|
+
private buildReinjectExpression;
|
|
53
|
+
private patchReinjectSourceForInvalidatedRuntime;
|
|
54
|
+
private resolveExecutionContextId;
|
|
55
|
+
private getTopFrameId;
|
|
56
|
+
private collectExecutionContexts;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Controller } from '../../chromium-types';
|
|
2
|
+
import { CDPClient } from '../cdp-client';
|
|
3
|
+
export declare function enableUnifiedLoggingForAllTargets(controller: Controller): Promise<void>;
|
|
4
|
+
export declare function enableRuntimeForAttachedTarget(controller: {
|
|
5
|
+
enableRuntimeForSession: (sessionId: string) => Promise<void>;
|
|
6
|
+
}, sessionId: string): Promise<void>;
|
|
7
|
+
export declare function registerAutoEnableLogging(cdp: CDPClient, getExtensionId: () => string | null): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type ContentScriptProbe = {
|
|
2
|
+
scriptPath: string;
|
|
3
|
+
probeId: string;
|
|
4
|
+
};
|
|
5
|
+
export type HmrIterationExpectation = {
|
|
6
|
+
scriptPath: string;
|
|
7
|
+
expectedToken: string;
|
|
8
|
+
};
|
|
9
|
+
export type HmrIterationResult = {
|
|
10
|
+
scriptPath: string;
|
|
11
|
+
expectedToken: string;
|
|
12
|
+
snapshotIndex: number;
|
|
13
|
+
passed: boolean;
|
|
14
|
+
reason: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function listManifestContentScriptFiles(manifest: unknown): string[];
|
|
17
|
+
export declare function contentScriptProbeId(scriptPath: string): string;
|
|
18
|
+
export declare function buildContentScriptProbePlan(manifest: unknown): ContentScriptProbe[];
|
|
19
|
+
export declare function buildIterationExpectations(probePlan: ContentScriptProbe[], tokenVersion: string): HmrIterationExpectation[];
|
|
20
|
+
export declare function extractUpdatedHtmlFromNdjson(output: string): string[];
|
|
21
|
+
export declare function evaluateDeterministicHmrIterations(expectations: HmrIterationExpectation[], updatedHtmlSnapshots: string[]): HmrIterationResult[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CDPClient } from './cdp-client';
|
|
2
|
+
export declare function getExtensionInfo(cdp: CDPClient, extensionId: string): Promise<{
|
|
3
|
+
extensionInfo?: {
|
|
4
|
+
name?: string;
|
|
5
|
+
version?: string;
|
|
6
|
+
};
|
|
7
|
+
}>;
|
|
8
|
+
export declare function loadUnpackedExtension(cdp: CDPClient, absPath: string): Promise<string>;
|
|
9
|
+
export declare function unloadExtension(cdp: CDPClient, extensionId: string): Promise<boolean>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { WebSocketServer } from 'ws';
|
|
2
|
+
import type { PluginInterface } from '../../browsers-types';
|
|
3
|
+
/**
|
|
4
|
+
* ChromiumSourceInspectionPlugin
|
|
5
|
+
*
|
|
6
|
+
* Intended responsibilities:
|
|
7
|
+
* - Dev-only page/extension inspection; attach to target and extract HTML
|
|
8
|
+
* - Optional watch mode to re-print HTML on file changes
|
|
9
|
+
*/
|
|
10
|
+
export declare class ChromiumSourceInspectionPlugin {
|
|
11
|
+
private devOptions;
|
|
12
|
+
private cdpClient;
|
|
13
|
+
private currentTargetId;
|
|
14
|
+
private currentSessionId;
|
|
15
|
+
private isInitialized;
|
|
16
|
+
private isWatching;
|
|
17
|
+
private hasInspectedSourceOnce;
|
|
18
|
+
private pendingWatchSourceUpdate;
|
|
19
|
+
private pendingWatchSourceRootMeta?;
|
|
20
|
+
private debounceTimer;
|
|
21
|
+
private watchSourceFlushTimer;
|
|
22
|
+
private isFlushingWatchSourceUpdate;
|
|
23
|
+
private lastFlushTimestamp;
|
|
24
|
+
private runtimeMode?;
|
|
25
|
+
private lastOutputHash?;
|
|
26
|
+
private lastByteLength?;
|
|
27
|
+
private lastSummary?;
|
|
28
|
+
private lastDomSnapshot?;
|
|
29
|
+
private consoleCounts;
|
|
30
|
+
private consoleTop;
|
|
31
|
+
constructor(devOptions: Pick<PluginInterface, 'port' | 'source' | 'watchSource'> & {
|
|
32
|
+
startingUrl?: string;
|
|
33
|
+
instanceId?: string;
|
|
34
|
+
}, _ctx?: unknown);
|
|
35
|
+
private isAuthorMode;
|
|
36
|
+
private getOutputConfig;
|
|
37
|
+
private getPageMetadata;
|
|
38
|
+
private getFrameContext;
|
|
39
|
+
private getDomSnapshot;
|
|
40
|
+
private getExtensionRootMeta;
|
|
41
|
+
/**
|
|
42
|
+
* Require structural evidence (counted roots or shadow style nodes) after the
|
|
43
|
+
* injection wait, with a short settle loop for async shadow hydration. Falls back to
|
|
44
|
+
* the same shadow-innerHTML probe as {@link waitForContentScriptInjection}.
|
|
45
|
+
*/
|
|
46
|
+
private shouldEmitContentScriptInjected;
|
|
47
|
+
private getPageMetaSnapshot;
|
|
48
|
+
private getSelectorProbes;
|
|
49
|
+
private getExtensionRootTree;
|
|
50
|
+
private setupConsoleCapture;
|
|
51
|
+
private recordConsoleEvent;
|
|
52
|
+
private buildPrettyTitle;
|
|
53
|
+
private emitSourceOutput;
|
|
54
|
+
private emitExtraOutputs;
|
|
55
|
+
private emitEventPayload;
|
|
56
|
+
private getShadowStyleSnapshot;
|
|
57
|
+
private getCdpPort;
|
|
58
|
+
initialize(port?: number): Promise<void>;
|
|
59
|
+
inspectSource(url: string, options?: {
|
|
60
|
+
forceNavigate?: boolean;
|
|
61
|
+
}): Promise<string>;
|
|
62
|
+
startWatching(websocketServer: WebSocketServer): Promise<void>;
|
|
63
|
+
private setupWebSocketHandler;
|
|
64
|
+
private setupConnectionHandler;
|
|
65
|
+
stopWatching(): void;
|
|
66
|
+
private registerContentReloadSnapshotHook;
|
|
67
|
+
private scheduleWatchSourceUpdate;
|
|
68
|
+
private emitImmediateUpdatedSnapshotFromCurrentSession;
|
|
69
|
+
private handleFileChange;
|
|
70
|
+
private waitForContentScriptReinjection;
|
|
71
|
+
private emitUpdatedSnapshotFromCurrentSession;
|
|
72
|
+
private waitForMeaningfulContentScriptContent;
|
|
73
|
+
private waitForContentScriptStyles;
|
|
74
|
+
private reconnectToTarget;
|
|
75
|
+
printHTML(html: string): Promise<void>;
|
|
76
|
+
printUpdatedHTML(html: string): Promise<void>;
|
|
77
|
+
cleanup(): Promise<void>;
|
|
78
|
+
apply(compiler: any): void;
|
|
79
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { CDPClient } from './cdp-client';
|
|
2
|
+
/** Serialized snapshot of extension content roots / reinject markers (same shape as ChromiumSourceInspectionPlugin root meta). */
|
|
3
|
+
export type ExtensionRootMetaPayload = {
|
|
4
|
+
rootCount: number;
|
|
5
|
+
markerCount: number;
|
|
6
|
+
latestGeneration: number;
|
|
7
|
+
roots: Array<{
|
|
8
|
+
tag: string;
|
|
9
|
+
id?: string;
|
|
10
|
+
key?: string;
|
|
11
|
+
generation?: number;
|
|
12
|
+
status?: string;
|
|
13
|
+
build?: string;
|
|
14
|
+
}>;
|
|
15
|
+
markers: Array<{
|
|
16
|
+
tag: string;
|
|
17
|
+
id?: string;
|
|
18
|
+
key?: string;
|
|
19
|
+
generation?: number;
|
|
20
|
+
status?: string;
|
|
21
|
+
build?: string;
|
|
22
|
+
}>;
|
|
23
|
+
registries: Array<{
|
|
24
|
+
key: string;
|
|
25
|
+
generation?: number;
|
|
26
|
+
hasCleanup?: boolean;
|
|
27
|
+
build?: string;
|
|
28
|
+
}>;
|
|
29
|
+
page?: {
|
|
30
|
+
key?: string;
|
|
31
|
+
generation?: number;
|
|
32
|
+
status?: string;
|
|
33
|
+
build?: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export declare function evaluateWithContentContext<T = unknown>(cdp: CDPClient, sessionId: string, expression: string, shouldAccept: (value: unknown) => boolean): Promise<T | undefined>;
|
|
37
|
+
export declare function evaluateExtensionRootMeta(cdp: CDPClient, sessionId: string): Promise<ExtensionRootMetaPayload | undefined>;
|
|
38
|
+
export declare function evaluateShadowStyleSnapshot(cdp: CDPClient, sessionId: string): Promise<Record<string, unknown> | undefined>;
|
|
39
|
+
/** Used after navigation when injection wait timed out — polls with isolated-world fallback. */
|
|
40
|
+
export declare function pollForVisibleShadowHostContent(cdp: CDPClient, sessionId: string, deadlineMs?: number): Promise<void>;
|
|
41
|
+
/** Single-shot check aligned with waitForContentScriptInjection shadow proof. */
|
|
42
|
+
export declare function hasVisibleShadowHostContent(cdp: CDPClient, sessionId: string): Promise<boolean>;
|
|
43
|
+
export declare function getPageHTML(cdp: CDPClient, sessionId: string, includeShadow?: 'off' | 'open-only' | 'all'): Promise<string>;
|
|
44
|
+
export declare function waitForLoadEvent(cdp: CDPClient, sessionId: string): Promise<void>;
|
|
45
|
+
export declare function waitForContentScriptInjection(cdp: CDPClient, sessionId: string): Promise<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function waitForChromeRemoteDebugging(port: number, instanceId?: string): Promise<void>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { BrowserLogger, LogLevel, PluginInterface, Controller } from '../browsers-types';
|
|
2
|
+
export type { Controller, LogFormat, LogLevel, PluginInterface } from '../browsers-types';
|
|
3
|
+
export interface ConsoleAPICalledEvent {
|
|
4
|
+
method: 'Runtime.consoleAPICalled';
|
|
5
|
+
params?: {
|
|
6
|
+
type?: string;
|
|
7
|
+
args?: Array<{
|
|
8
|
+
value?: unknown;
|
|
9
|
+
description?: string;
|
|
10
|
+
}>;
|
|
11
|
+
stackTrace?: {
|
|
12
|
+
callFrames?: Array<{
|
|
13
|
+
url?: string;
|
|
14
|
+
lineNumber?: number;
|
|
15
|
+
columnNumber?: number;
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface LogEntryAddedEvent {
|
|
21
|
+
method: 'Log.entryAdded';
|
|
22
|
+
params?: {
|
|
23
|
+
entry?: {
|
|
24
|
+
level?: string;
|
|
25
|
+
text?: string;
|
|
26
|
+
url?: string;
|
|
27
|
+
lineNumber?: number;
|
|
28
|
+
columnNumber?: number;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export type CdpEvent = ConsoleAPICalledEvent | LogEntryAddedEvent | {
|
|
33
|
+
method: string;
|
|
34
|
+
params?: unknown;
|
|
35
|
+
};
|
|
36
|
+
export type PendingReason = 'manifest' | 'locales' | 'sw';
|
|
37
|
+
export type Logger = BrowserLogger;
|
|
38
|
+
/**
|
|
39
|
+
* Options consumed by Chromium plugins (launch/logger/reload/inspection).
|
|
40
|
+
* Narrowed from PluginInterface and specialized for Chromium path.
|
|
41
|
+
*/
|
|
42
|
+
export interface ChromiumLaunchOptions extends Pick<PluginInterface, 'extension' | 'browser' | 'noOpen' | 'browserFlags' | 'excludeBrowserFlags' | 'profile' | 'preferences' | 'startingUrl' | 'chromiumBinary' | 'instanceId' | 'port' | 'source' | 'watchSource' | 'sourceFormat' | 'sourceSummary' | 'sourceMeta' | 'sourceProbe' | 'sourceTree' | 'sourceConsole' | 'sourceDom' | 'sourceMaxBytes' | 'sourceRedact' | 'sourceIncludeShadow' | 'sourceDiff' | 'dryRun' | 'logLevel' | 'logContexts' | 'logFormat' | 'logTimestamps' | 'logColor' | 'logUrl' | 'logTab'> {
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Runtime state in Chromium flow.
|
|
46
|
+
* Kept Chromium-specific to avoid polluting shared browser types.
|
|
47
|
+
*/
|
|
48
|
+
export interface ChromiumPluginRuntime extends ChromiumLaunchOptions {
|
|
49
|
+
bannerPrintedOnce?: boolean;
|
|
50
|
+
cdpController?: Controller;
|
|
51
|
+
browserVersionLine?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Configuration for the unified logger in Chromium flows.
|
|
55
|
+
* Mirrors CLI flags and shared logging options.
|
|
56
|
+
*/
|
|
57
|
+
export interface ChromiumLogger {
|
|
58
|
+
level?: LogLevel | 'off' | string;
|
|
59
|
+
contexts?: string[];
|
|
60
|
+
urlFilter?: string;
|
|
61
|
+
tabFilter?: number | string;
|
|
62
|
+
format?: 'pretty' | 'json' | 'ndjson' | string;
|
|
63
|
+
timestamps?: boolean;
|
|
64
|
+
color?: boolean;
|
|
65
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ChromiumContext } from '../chromium-context';
|
|
2
|
+
/**
|
|
3
|
+
* ChromiumUnifiedLoggerPlugin
|
|
4
|
+
*
|
|
5
|
+
* Intended responsibilities:
|
|
6
|
+
* - Wait for controller readiness; enable unified CDP logging
|
|
7
|
+
* - Respect level/contexts/filters/format/timestamps/color
|
|
8
|
+
*/
|
|
9
|
+
export declare class ChromiumUnifiedLoggerPlugin {
|
|
10
|
+
private readonly options;
|
|
11
|
+
private readonly ctx;
|
|
12
|
+
constructor(options: {
|
|
13
|
+
logLevel?: string;
|
|
14
|
+
logContexts?: string[];
|
|
15
|
+
logUrl?: string;
|
|
16
|
+
logTab?: number | string;
|
|
17
|
+
logFormat?: 'pretty' | 'json' | 'ndjson';
|
|
18
|
+
logTimestamps?: boolean;
|
|
19
|
+
logColor?: boolean;
|
|
20
|
+
}, ctx: ChromiumContext);
|
|
21
|
+
apply(_compiler: any): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare function waitForStableManifest(outPath: string, options?: {
|
|
2
|
+
timeoutMs?: number;
|
|
3
|
+
pollIntervalMs?: number;
|
|
4
|
+
stableReadsRequired?: number;
|
|
5
|
+
}): Promise<boolean>;
|
|
6
|
+
export declare function waitForStableFiles(outPath: string, relativeFiles: string[], options?: {
|
|
7
|
+
timeoutMs?: number;
|
|
8
|
+
pollIntervalMs?: number;
|
|
9
|
+
stableReadsRequired?: number;
|
|
10
|
+
}): Promise<boolean>;
|
|
11
|
+
export declare function waitForStableExtensionOutput(outPath: string, options?: {
|
|
12
|
+
timeoutMs?: number;
|
|
13
|
+
pollIntervalMs?: number;
|
|
14
|
+
stableReadsRequired?: number;
|
|
15
|
+
}): Promise<boolean>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { BrowserLogger } from '../../browsers-types';
|
|
2
|
+
import type { FirefoxRDPController } from '../firefox-source-inspection/rdp-extension-controller';
|
|
3
|
+
export type PendingReason = 'manifest' | 'locales' | 'sw';
|
|
4
|
+
export type FirefoxContext = {
|
|
5
|
+
getController(): FirefoxRDPController | undefined;
|
|
6
|
+
onControllerReady(cb: (c: FirefoxRDPController, port: number) => void): void;
|
|
7
|
+
setController(c: FirefoxRDPController, port: number): void;
|
|
8
|
+
getPorts(): {
|
|
9
|
+
rdpPort?: number;
|
|
10
|
+
};
|
|
11
|
+
setExtensionRoot(root?: string): void;
|
|
12
|
+
getExtensionRoot(): string | undefined;
|
|
13
|
+
setServiceWorkerPaths(rel?: string, abs?: string): void;
|
|
14
|
+
getServiceWorkerPaths(): {
|
|
15
|
+
relativePath?: string;
|
|
16
|
+
absolutePath?: string;
|
|
17
|
+
};
|
|
18
|
+
setPendingReloadReason(reason?: PendingReason): void;
|
|
19
|
+
getPendingReloadReason(): PendingReason | undefined;
|
|
20
|
+
clearPendingReloadReason(): void;
|
|
21
|
+
logger?: BrowserLogger;
|
|
22
|
+
didLaunch?: boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare function createFirefoxContext(): FirefoxContext;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class FirefoxBinaryDetector {
|
|
2
|
+
static generateFirefoxArgs(binaryPath: string, profilePath: string, debugPort: number, additionalArgs?: string[]): {
|
|
3
|
+
binary: string;
|
|
4
|
+
args: string[];
|
|
5
|
+
};
|
|
6
|
+
static validateFirefoxBinary(binaryPath: string): Promise<{
|
|
7
|
+
version: string;
|
|
8
|
+
path: string;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CompilationLike } from '../../browsers-types';
|
|
2
|
+
import type { BrowserType, BrowserConfig } from '../../browsers-types';
|
|
3
|
+
type BrowserConfigOptions = {
|
|
4
|
+
browser: BrowserType;
|
|
5
|
+
mode: 'development' | 'production' | 'none';
|
|
6
|
+
browserFlags?: string[];
|
|
7
|
+
excludeBrowserFlags?: string[];
|
|
8
|
+
profile?: string | false;
|
|
9
|
+
preferences?: Record<string, unknown>;
|
|
10
|
+
startingUrl?: string;
|
|
11
|
+
port?: number | string;
|
|
12
|
+
noOpen?: boolean;
|
|
13
|
+
} & BrowserConfig & {
|
|
14
|
+
keepProfileChanges?: boolean;
|
|
15
|
+
copyFromProfile?: string;
|
|
16
|
+
instanceId?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function browserConfig(compilation: CompilationLike, configOptions: BrowserConfigOptions): Promise<string>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function logFirefoxDryRun(browserBinaryLocation: string, firefoxConfig: string): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CompilationLike } from '../../browsers-types';
|
|
2
|
+
import type { FirefoxContext } from '../firefox-context';
|
|
3
|
+
import type { BrowserType, BrowserConfig } from '../../browsers-types';
|
|
4
|
+
import type { FirefoxPluginRuntime } from '../firefox-types';
|
|
5
|
+
type LaunchOptions = {
|
|
6
|
+
browser: BrowserType;
|
|
7
|
+
mode: 'development' | 'production' | 'none';
|
|
8
|
+
browserFlags?: string[];
|
|
9
|
+
excludeBrowserFlags?: string[];
|
|
10
|
+
profile?: string | false;
|
|
11
|
+
preferences?: Record<string, unknown>;
|
|
12
|
+
startingUrl?: string;
|
|
13
|
+
port?: number | string;
|
|
14
|
+
noOpen?: boolean;
|
|
15
|
+
} & BrowserConfig;
|
|
16
|
+
export declare class FirefoxLaunchPlugin {
|
|
17
|
+
private readonly host;
|
|
18
|
+
private readonly ctx;
|
|
19
|
+
private child;
|
|
20
|
+
private watchTimeout?;
|
|
21
|
+
constructor(host: FirefoxPluginRuntime, ctx: FirefoxContext);
|
|
22
|
+
/**
|
|
23
|
+
* Run the Firefox launch flow without requiring a bundler compiler instance.
|
|
24
|
+
* Intended for run-only preview paths.
|
|
25
|
+
*/
|
|
26
|
+
runOnce(compilation: CompilationLike, options: LaunchOptions): Promise<void>;
|
|
27
|
+
apply(compiler: any): void;
|
|
28
|
+
private launch;
|
|
29
|
+
private resolveSpawnStdio;
|
|
30
|
+
private spawnFirefoxChild;
|
|
31
|
+
private pipeChildOutput;
|
|
32
|
+
private wireChildLifecycle;
|
|
33
|
+
private cleanupInstance;
|
|
34
|
+
private scheduleWatchTimeout;
|
|
35
|
+
private printInstallHint;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
declare const masterPreferences: {
|
|
2
|
+
'browser.aboutwelcome.enabled': boolean;
|
|
3
|
+
'browser.startup.homepage_override.mstone': string;
|
|
4
|
+
'browser.shell.didSkipDefaultBrowserCheckOnFirstRun': boolean;
|
|
5
|
+
'datareporting.policy.dataSubmissionPolicyBypassNotification': boolean;
|
|
6
|
+
'browser.startup.upgradeDialog.enabled': boolean;
|
|
7
|
+
'browser.messaging-system.whatsNewPanel.enabled': boolean;
|
|
8
|
+
'browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons': boolean;
|
|
9
|
+
'browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features': boolean;
|
|
10
|
+
'browser.startup.homepage_override_url': string;
|
|
11
|
+
'app.update.enabled': boolean;
|
|
12
|
+
'browser.dom.window.dump.enabled': boolean;
|
|
13
|
+
'browser.formfill.enable': boolean;
|
|
14
|
+
'browser.link.open_newwindow': number;
|
|
15
|
+
'browser.sessionstore.enabled': boolean;
|
|
16
|
+
'browser.sessionstore.resume_from_crash': boolean;
|
|
17
|
+
'browser.sessionstore.max_resumed_crashes': number;
|
|
18
|
+
'browser.sessionstore.restore_on_demand': boolean;
|
|
19
|
+
'browser.sessionstore.resume_session_once': boolean;
|
|
20
|
+
'toolkit.startup.max_resumed_crashes': number;
|
|
21
|
+
'browser.shell.checkDefaultBrowser': boolean;
|
|
22
|
+
'browser.sync.enabled': boolean;
|
|
23
|
+
'browser.startup.page': number;
|
|
24
|
+
'browser.startup.homepage_welcome_url': string;
|
|
25
|
+
'browser.startup.homepage_welcome_url_additional': string;
|
|
26
|
+
'browser.urlbar.suggest.bookmark': boolean;
|
|
27
|
+
'browser.urlbar.suggest.clipboard': boolean;
|
|
28
|
+
'browser.urlbar.suggest.history': boolean;
|
|
29
|
+
'browser.urlbar.suggest.openpage': boolean;
|
|
30
|
+
'browser.urlbar.suggest.remotetab': boolean;
|
|
31
|
+
'browser.urlbar.suggest.searches': boolean;
|
|
32
|
+
'browser.urlbar.suggest.topsites': boolean;
|
|
33
|
+
'browser.urlbar.suggest.engines': boolean;
|
|
34
|
+
'browser.urlbar.suggest.calculator': boolean;
|
|
35
|
+
'browser.urlbar.suggest.recentsearches': boolean;
|
|
36
|
+
'browser.newtabpage.enabled': boolean;
|
|
37
|
+
'browser.newtabpage.activity-stream.showSearch': boolean;
|
|
38
|
+
'browser.newtabpage.activity-stream.showSponsored': boolean;
|
|
39
|
+
'browser.newtabpage.activity-stream.feeds.topsites': boolean;
|
|
40
|
+
'browser.newtabpage.activity-stream.feeds.section.topstories': boolean;
|
|
41
|
+
'browser.newtabpage.activity-stream.feeds.snippets': boolean;
|
|
42
|
+
'browser.newtabpage.activity-stream.improvesearch.handoffToAwesomebar': boolean;
|
|
43
|
+
'datareporting.policy.dataSubmissionEnabled': boolean;
|
|
44
|
+
'datareporting.policy.firstRunURL': string;
|
|
45
|
+
'devtools.browserconsole.contentMessages': boolean;
|
|
46
|
+
'devtools.chrome.enabled': boolean;
|
|
47
|
+
'devtools.debugger.prompt-connection': boolean;
|
|
48
|
+
'devtools.debugger.remote-enabled': boolean;
|
|
49
|
+
'devtools.errorconsole.enabled': boolean;
|
|
50
|
+
'extensions.installDistroAddons': boolean;
|
|
51
|
+
'extensions.autoDisableScopes': number;
|
|
52
|
+
'extensions.chrome.enabled': boolean;
|
|
53
|
+
'extensions.logging.enabled': boolean;
|
|
54
|
+
'extensions.checkCompatibility.nightly': boolean;
|
|
55
|
+
'extensions.update.enabled': boolean;
|
|
56
|
+
'extensions.update.notifyUser': boolean;
|
|
57
|
+
'extensions.enabledScopes': number;
|
|
58
|
+
'extensions.getAddons.cache.enabled': boolean;
|
|
59
|
+
'network.prefetch.next': boolean;
|
|
60
|
+
'network.speculative.preconnect.enabled': boolean;
|
|
61
|
+
'toolkit.telemetry.enabled': boolean;
|
|
62
|
+
'toolkit.telemetry.archive.enabled': boolean;
|
|
63
|
+
'toolkit.telemetry.newProfilePing.enabled': boolean;
|
|
64
|
+
'toolkit.recovery.enabled': boolean;
|
|
65
|
+
'urlclassifier.updateinterval': number;
|
|
66
|
+
'security.enterprise_roots.enabled': boolean;
|
|
67
|
+
'xpinstall.signatures.required': boolean;
|
|
68
|
+
};
|
|
69
|
+
export default masterPreferences;
|
|
70
|
+
export declare function getPreferences(customPrefs: Record<string, any>): {
|
|
71
|
+
'browser.aboutwelcome.enabled': boolean;
|
|
72
|
+
'browser.startup.homepage_override.mstone': string;
|
|
73
|
+
'browser.shell.didSkipDefaultBrowserCheckOnFirstRun': boolean;
|
|
74
|
+
'datareporting.policy.dataSubmissionPolicyBypassNotification': boolean;
|
|
75
|
+
'browser.startup.upgradeDialog.enabled': boolean;
|
|
76
|
+
'browser.messaging-system.whatsNewPanel.enabled': boolean;
|
|
77
|
+
'browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons': boolean;
|
|
78
|
+
'browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features': boolean;
|
|
79
|
+
'browser.startup.homepage_override_url': string;
|
|
80
|
+
'app.update.enabled': boolean;
|
|
81
|
+
'browser.dom.window.dump.enabled': boolean;
|
|
82
|
+
'browser.formfill.enable': boolean;
|
|
83
|
+
'browser.link.open_newwindow': number;
|
|
84
|
+
'browser.sessionstore.enabled': boolean;
|
|
85
|
+
'browser.sessionstore.resume_from_crash': boolean;
|
|
86
|
+
'browser.sessionstore.max_resumed_crashes': number;
|
|
87
|
+
'browser.sessionstore.restore_on_demand': boolean;
|
|
88
|
+
'browser.sessionstore.resume_session_once': boolean;
|
|
89
|
+
'toolkit.startup.max_resumed_crashes': number;
|
|
90
|
+
'browser.shell.checkDefaultBrowser': boolean;
|
|
91
|
+
'browser.sync.enabled': boolean;
|
|
92
|
+
'browser.startup.page': number;
|
|
93
|
+
'browser.startup.homepage_welcome_url': string;
|
|
94
|
+
'browser.startup.homepage_welcome_url_additional': string;
|
|
95
|
+
'browser.urlbar.suggest.bookmark': boolean;
|
|
96
|
+
'browser.urlbar.suggest.clipboard': boolean;
|
|
97
|
+
'browser.urlbar.suggest.history': boolean;
|
|
98
|
+
'browser.urlbar.suggest.openpage': boolean;
|
|
99
|
+
'browser.urlbar.suggest.remotetab': boolean;
|
|
100
|
+
'browser.urlbar.suggest.searches': boolean;
|
|
101
|
+
'browser.urlbar.suggest.topsites': boolean;
|
|
102
|
+
'browser.urlbar.suggest.engines': boolean;
|
|
103
|
+
'browser.urlbar.suggest.calculator': boolean;
|
|
104
|
+
'browser.urlbar.suggest.recentsearches': boolean;
|
|
105
|
+
'browser.newtabpage.enabled': boolean;
|
|
106
|
+
'browser.newtabpage.activity-stream.showSearch': boolean;
|
|
107
|
+
'browser.newtabpage.activity-stream.showSponsored': boolean;
|
|
108
|
+
'browser.newtabpage.activity-stream.feeds.topsites': boolean;
|
|
109
|
+
'browser.newtabpage.activity-stream.feeds.section.topstories': boolean;
|
|
110
|
+
'browser.newtabpage.activity-stream.feeds.snippets': boolean;
|
|
111
|
+
'browser.newtabpage.activity-stream.improvesearch.handoffToAwesomebar': boolean;
|
|
112
|
+
'datareporting.policy.dataSubmissionEnabled': boolean;
|
|
113
|
+
'datareporting.policy.firstRunURL': string;
|
|
114
|
+
'devtools.browserconsole.contentMessages': boolean;
|
|
115
|
+
'devtools.chrome.enabled': boolean;
|
|
116
|
+
'devtools.debugger.prompt-connection': boolean;
|
|
117
|
+
'devtools.debugger.remote-enabled': boolean;
|
|
118
|
+
'devtools.errorconsole.enabled': boolean;
|
|
119
|
+
'extensions.installDistroAddons': boolean;
|
|
120
|
+
'extensions.autoDisableScopes': number;
|
|
121
|
+
'extensions.chrome.enabled': boolean;
|
|
122
|
+
'extensions.logging.enabled': boolean;
|
|
123
|
+
'extensions.checkCompatibility.nightly': boolean;
|
|
124
|
+
'extensions.update.enabled': boolean;
|
|
125
|
+
'extensions.update.notifyUser': boolean;
|
|
126
|
+
'extensions.enabledScopes': number;
|
|
127
|
+
'extensions.getAddons.cache.enabled': boolean;
|
|
128
|
+
'network.prefetch.next': boolean;
|
|
129
|
+
'network.speculative.preconnect.enabled': boolean;
|
|
130
|
+
'toolkit.telemetry.enabled': boolean;
|
|
131
|
+
'toolkit.telemetry.archive.enabled': boolean;
|
|
132
|
+
'toolkit.telemetry.newProfilePing.enabled': boolean;
|
|
133
|
+
'toolkit.recovery.enabled': boolean;
|
|
134
|
+
'urlclassifier.updateinterval': number;
|
|
135
|
+
'security.enterprise_roots.enabled': boolean;
|
|
136
|
+
'xpinstall.signatures.required': boolean;
|
|
137
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CompilationLike } from '../../browsers-types';
|
|
2
|
+
import { FirefoxRDPController } from '../firefox-source-inspection/rdp-extension-controller';
|
|
3
|
+
import type { FirefoxPluginRuntime } from '../firefox-types';
|
|
4
|
+
export declare function setupRdpAfterLaunch(plugin: FirefoxPluginRuntime & {
|
|
5
|
+
[k: string]: unknown;
|
|
6
|
+
}, compilation: CompilationLike, debugPort: number): Promise<FirefoxRDPController>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ChildProcess } from 'child_process';
|
|
2
|
+
type FirefoxLogger = {
|
|
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(): string | null;
|
|
8
|
+
export declare function spawnFirefoxProcess(opts: {
|
|
9
|
+
binary: string;
|
|
10
|
+
args: string[];
|
|
11
|
+
stdio: any;
|
|
12
|
+
fallbackBinary?: string | null;
|
|
13
|
+
logger?: FirefoxLogger;
|
|
14
|
+
}): Promise<ChildProcess>;
|
|
15
|
+
export {};
|