extension 3.12.0 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/656.cjs +2481 -0
- package/dist/859.cjs +1930 -0
- package/dist/browser/browsers-lib/banner.d.ts +37 -0
- package/dist/browser/browsers-lib/constants.d.ts +2 -0
- package/dist/browser/browsers-lib/content-script-contracts.d.ts +2 -0
- package/dist/browser/browsers-lib/content-script-targets.d.ts +33 -0
- package/dist/browser/browsers-lib/html-merge.d.ts +1 -0
- package/dist/browser/browsers-lib/instance-registry.d.ts +8 -0
- package/dist/browser/browsers-lib/messages.d.ts +208 -0
- package/dist/browser/browsers-lib/output-binaries-resolver.d.ts +5 -0
- package/dist/browser/browsers-lib/ready-message.d.ts +1 -0
- package/dist/browser/browsers-lib/runtime-options.d.ts +12 -0
- package/dist/browser/browsers-lib/shared-utils.d.ts +11 -0
- package/dist/browser/browsers-types.d.ts +270 -0
- package/dist/browser/index.d.ts +74 -0
- package/dist/browser/run-chromium/chromium-context/index.d.ts +20 -0
- package/dist/browser/run-chromium/chromium-launch/browser-config.d.ts +4 -0
- package/dist/browser/run-chromium/chromium-launch/dry-run.d.ts +1 -0
- package/dist/browser/run-chromium/chromium-launch/extension-output-path.d.ts +8 -0
- package/dist/browser/run-chromium/chromium-launch/index.d.ts +31 -0
- package/dist/browser/run-chromium/chromium-launch/master-preferences.d.ts +163 -0
- package/dist/browser/run-chromium/chromium-launch/process-handlers.d.ts +3 -0
- package/dist/browser/run-chromium/chromium-launch/setup-cdp-after-launch.d.ts +3 -0
- package/dist/browser/run-chromium/chromium-launch/wsl-support.d.ts +15 -0
- package/dist/browser/run-chromium/chromium-source-inspection/cdp-client.d.ts +57 -0
- package/dist/browser/run-chromium/chromium-source-inspection/cdp-extension-controller/connect.d.ts +2 -0
- package/dist/browser/run-chromium/chromium-source-inspection/cdp-extension-controller/derive-id.d.ts +2 -0
- package/dist/browser/run-chromium/chromium-source-inspection/cdp-extension-controller/ensure.d.ts +6 -0
- package/dist/browser/run-chromium/chromium-source-inspection/cdp-extension-controller/index.d.ts +58 -0
- package/dist/browser/run-chromium/chromium-source-inspection/cdp-extension-controller/logging.d.ts +7 -0
- package/dist/browser/run-chromium/chromium-source-inspection/discovery.d.ts +2 -0
- package/dist/browser/run-chromium/chromium-source-inspection/extensions.d.ts +9 -0
- package/dist/browser/run-chromium/chromium-source-inspection/page.d.ts +45 -0
- package/dist/browser/run-chromium/chromium-source-inspection/ws.d.ts +2 -0
- package/dist/browser/run-chromium/chromium-types.d.ts +65 -0
- package/dist/browser/run-chromium/manifest-readiness.d.ts +15 -0
- package/dist/browser/run-firefox/firefox-context/index.d.ts +24 -0
- package/dist/browser/run-firefox/firefox-launch/binary-detector.d.ts +10 -0
- package/dist/browser/run-firefox/firefox-launch/browser-config.d.ts +19 -0
- package/dist/browser/run-firefox/firefox-launch/dry-run.d.ts +1 -0
- package/dist/browser/run-firefox/firefox-launch/index.d.ts +37 -0
- package/dist/browser/run-firefox/firefox-launch/master-preferences.d.ts +137 -0
- package/dist/browser/run-firefox/firefox-launch/process-handlers.d.ts +2 -0
- package/dist/browser/run-firefox/firefox-launch/setup-rdp-after-launch.d.ts +6 -0
- package/dist/browser/run-firefox/firefox-launch/wsl-support.d.ts +15 -0
- package/dist/browser/run-firefox/firefox-source-inspection/rdp-extension-controller/index.d.ts +38 -0
- package/dist/browser/run-firefox/firefox-source-inspection/remote-firefox/addons-install.d.ts +10 -0
- package/dist/browser/run-firefox/firefox-source-inspection/remote-firefox/addons.d.ts +1 -0
- package/dist/browser/run-firefox/firefox-source-inspection/remote-firefox/evaluate.d.ts +18 -0
- package/dist/browser/run-firefox/firefox-source-inspection/remote-firefox/firefox-utils.d.ts +17 -0
- package/dist/browser/run-firefox/firefox-source-inspection/remote-firefox/index.d.ts +38 -0
- package/dist/browser/run-firefox/firefox-source-inspection/remote-firefox/logging.d.ts +11 -0
- package/dist/browser/run-firefox/firefox-source-inspection/remote-firefox/message-utils.d.ts +2 -0
- package/dist/browser/run-firefox/firefox-source-inspection/remote-firefox/messaging-client.d.ts +37 -0
- package/dist/browser/run-firefox/firefox-source-inspection/remote-firefox/moz-id.d.ts +2 -0
- package/dist/browser/run-firefox/firefox-source-inspection/remote-firefox/rdp-api.d.ts +29 -0
- package/dist/browser/run-firefox/firefox-source-inspection/remote-firefox/rdp-wire.d.ts +8 -0
- package/dist/browser/run-firefox/firefox-source-inspection/remote-firefox/source-inspect.d.ts +9 -0
- package/dist/browser/run-firefox/firefox-source-inspection/remote-firefox/transport.d.ts +20 -0
- package/dist/browser/run-firefox/firefox-types.d.ts +16 -0
- package/dist/browser/run-only.d.ts +22 -0
- package/dist/cli/cli-lib/extension-develop-runtime.d.ts +9 -0
- package/dist/{utils.d.ts → cli/utils.d.ts} +0 -1
- package/dist/cli.cjs +9943 -1964
- package/package.json +7 -8
- package/dist/cli-lib/extension-develop-runtime.d.ts +0 -3
- /package/dist/{check-updates.d.ts → cli/check-updates.d.ts} +0 -0
- /package/dist/{cli-lib → cli/cli-lib}/manifest-summary.d.ts +0 -0
- /package/dist/{cli-lib → cli/cli-lib}/messages.d.ts +0 -0
- /package/dist/{cli-lib → cli/cli-lib}/project-profile.d.ts +0 -0
- /package/dist/{cli-lib → cli/cli-lib}/telemetry-cli.d.ts +0 -0
- /package/dist/{cli-lib → cli/cli-lib}/telemetry.d.ts +0 -0
- /package/dist/{cli-lib → cli/cli-lib}/workflow-profile.d.ts +0 -0
- /package/dist/{cli-package-json.d.ts → cli/cli-package-json.d.ts} +0 -0
- /package/dist/{commands → cli/commands}/build.d.ts +0 -0
- /package/dist/{commands → cli/commands}/create.d.ts +0 -0
- /package/dist/{commands → cli/commands}/dev-wait.d.ts +0 -0
- /package/dist/{commands → cli/commands}/dev.d.ts +0 -0
- /package/dist/{commands → cli/commands}/install.d.ts +0 -0
- /package/dist/{commands → cli/commands}/preview.d.ts +0 -0
- /package/dist/{commands → cli/commands}/start.d.ts +0 -0
- /package/dist/{index.d.ts → cli/index.d.ts} +0 -0
- /package/dist/{rslib.config.d.ts → cli/rslib.config.d.ts} +0 -0
- /package/dist/{utils → cli/utils}/normalize-options.d.ts +0 -0
- /package/dist/{vitest.config.d.ts → cli/vitest.config.d.ts} +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { BrowserType } from '../browsers-types';
|
|
2
|
+
export declare function isBannerPrinted(): boolean;
|
|
3
|
+
type Info = {
|
|
4
|
+
extensionId?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
version?: string;
|
|
7
|
+
} | null;
|
|
8
|
+
type HostPort = {
|
|
9
|
+
host?: string;
|
|
10
|
+
port?: number | string;
|
|
11
|
+
};
|
|
12
|
+
export declare function printDevBannerOnce(opts: {
|
|
13
|
+
browser: BrowserType;
|
|
14
|
+
outPath: string;
|
|
15
|
+
hostPort?: HostPort;
|
|
16
|
+
getInfo: () => Promise<Info>;
|
|
17
|
+
fallback?: {
|
|
18
|
+
name?: string;
|
|
19
|
+
version?: string;
|
|
20
|
+
extensionId?: string;
|
|
21
|
+
};
|
|
22
|
+
browserVersionLine?: string;
|
|
23
|
+
}): Promise<boolean>;
|
|
24
|
+
export declare function printProdBannerOnce(opts: {
|
|
25
|
+
browser: BrowserType;
|
|
26
|
+
outPath: string;
|
|
27
|
+
browserVersionLine?: string;
|
|
28
|
+
runtime?: {
|
|
29
|
+
extensionId?: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
version?: string;
|
|
32
|
+
};
|
|
33
|
+
includeExtensionId?: boolean;
|
|
34
|
+
readyPath?: string;
|
|
35
|
+
includeRunId?: boolean;
|
|
36
|
+
}): Promise<boolean>;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CompilationLike } from '../browsers-types';
|
|
2
|
+
export type ContentScriptTargetRule = {
|
|
3
|
+
index: number;
|
|
4
|
+
world: 'extension' | 'main';
|
|
5
|
+
matches: string[];
|
|
6
|
+
excludeMatches: string[];
|
|
7
|
+
includeGlobs: string[];
|
|
8
|
+
excludeGlobs: string[];
|
|
9
|
+
};
|
|
10
|
+
type ManifestLike = {
|
|
11
|
+
content_scripts?: Array<{
|
|
12
|
+
world?: string;
|
|
13
|
+
matches?: string[];
|
|
14
|
+
exclude_matches?: string[];
|
|
15
|
+
include_globs?: string[];
|
|
16
|
+
exclude_globs?: string[];
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
19
|
+
export declare function isContentScriptEntryName(entryName: string): boolean;
|
|
20
|
+
export declare function isCanonicalContentScriptAsset(assetName: string): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Resolves the on-disk file for a canonical content bundle. In development the
|
|
23
|
+
* emitted name may include a fullhash (e.g. content_scripts/content-0.a1b2c3d4.js).
|
|
24
|
+
*/
|
|
25
|
+
export declare function resolveEmittedContentScriptFile(extensionOutPath: string, index: number, ext: 'js' | 'css'): string | null;
|
|
26
|
+
export declare function getChangedContentScriptEntryNames(modifiedFilePaths: string[], dependencyPathsByEntry: Map<string, Set<string>>): string[];
|
|
27
|
+
export declare function normalizeModuleResourcePath(resourcePath: unknown): string | undefined;
|
|
28
|
+
export declare function readContentScriptRules(compilation: CompilationLike, extensionRoot?: string): ContentScriptTargetRule[];
|
|
29
|
+
export declare function getContentScriptRulesFromManifest(manifest: ManifestLike): ContentScriptTargetRule[];
|
|
30
|
+
export declare function selectContentScriptRules(rules: ContentScriptTargetRule[], entryNames: string[]): ContentScriptTargetRule[];
|
|
31
|
+
export declare function urlMatchesContentScriptRule(rawUrl: string, rule: ContentScriptTargetRule): boolean;
|
|
32
|
+
export declare function urlMatchesAnyContentScriptRule(rawUrl: string, rules: ContentScriptTargetRule[]): boolean;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function mergeShadowIntoDocument(mainHTML: string, shadowContent: string): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type InstanceRecord = {
|
|
2
|
+
cdpPort?: number;
|
|
3
|
+
rdpPort?: number;
|
|
4
|
+
};
|
|
5
|
+
export declare function setInstancePorts(instanceId: string | undefined, ports: InstanceRecord): void;
|
|
6
|
+
export declare function getInstancePorts(instanceId: string | undefined): InstanceRecord | undefined;
|
|
7
|
+
export declare function getLastCDPPort(): number | undefined;
|
|
8
|
+
export declare function getLastRDPPort(): number | undefined;
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import type { BrowserType } from '../browsers-types';
|
|
2
|
+
type Browser = BrowserType;
|
|
3
|
+
type Mode = 'development' | 'production' | 'none';
|
|
4
|
+
export declare function capitalizedBrowserName(browser: Browser): string;
|
|
5
|
+
export declare function creatingUserProfile(profilePath: string): string;
|
|
6
|
+
export declare function browserInstanceAlreadyRunning(browser: Browser): string;
|
|
7
|
+
export declare function browserInstanceExited(browser: Browser): string;
|
|
8
|
+
export declare function stdoutData(browser: Browser, mode: Mode): string;
|
|
9
|
+
export declare function cdpClientAttachedToTarget(sessionId: string, targetType: string): string;
|
|
10
|
+
export declare function cdpPendingRejectFailed(message: string): string;
|
|
11
|
+
export declare function cdpFailedToHandleMessage(message: string): string;
|
|
12
|
+
export declare function cdpAutoAttachSetupFailed(message: string): string;
|
|
13
|
+
export declare function cdpProtocolEventHandlerError(message: string): string;
|
|
14
|
+
export declare function cdpFallbackManifestReadFailed(message: string): string;
|
|
15
|
+
export declare function bannerEventHandlerFailed(message: string): string;
|
|
16
|
+
export declare function bestEffortBannerPrintFailed(message: string): string;
|
|
17
|
+
export declare function firefoxUnifiedLoggingFailed(message: string): string;
|
|
18
|
+
export declare function firefoxRdpReloadCapabilitySummary(mode: 'native' | 'reinstall'): string;
|
|
19
|
+
export declare function rdpAddTabFailed(message: string): string;
|
|
20
|
+
export declare function skippingBrowserLaunchDueToCompileErrors(): string;
|
|
21
|
+
export declare function manifestPreflightSummary(errorCount: number): string;
|
|
22
|
+
export declare function browserNotInstalledError(browser: Browser, browserBinaryLocation: string): string;
|
|
23
|
+
export declare function installDifferentBrowserHint(): string;
|
|
24
|
+
export declare function injectingAddOnsError(browser: Browser, error: unknown): string;
|
|
25
|
+
export declare function firefoxServiceWorkerError(browser: Browser): string;
|
|
26
|
+
export declare function browserLaunchError(browser: Browser, error: unknown): string;
|
|
27
|
+
export declare function enhancedProcessManagementStarting(browser: Browser): string;
|
|
28
|
+
export declare function enhancedProcessManagementCleanup(browser: Browser): string;
|
|
29
|
+
export declare function enhancedProcessManagementTerminating(browser: Browser): string;
|
|
30
|
+
export declare function enhancedProcessManagementForceKill(browser: Browser): string;
|
|
31
|
+
export declare function enhancedProcessManagementCleanupError(browser: Browser, error: unknown): string;
|
|
32
|
+
export declare function enhancedProcessManagementInstanceCleanup(browser: Browser): string;
|
|
33
|
+
export declare function enhancedProcessManagementInstanceCleanupComplete(browser: Browser): string;
|
|
34
|
+
export declare function enhancedProcessManagementSignalHandling(browser: Browser): string;
|
|
35
|
+
export declare function enhancedProcessManagementUncaughtException(browser: Browser, error: unknown): string;
|
|
36
|
+
export declare function enhancedProcessManagementUnhandledRejection(browser: Browser, reason: unknown): string;
|
|
37
|
+
export declare function generalBrowserError(browser: Browser, error: unknown): string;
|
|
38
|
+
export declare function errorConnectingToBrowser(browser: Browser): string;
|
|
39
|
+
export declare function addonInstallError(browser: Browser, message: string): string;
|
|
40
|
+
export declare function pathIsNotDirectoryError(browser: Browser, profilePath: string): string;
|
|
41
|
+
export declare function messagingClientClosedError(browser: Browser): string;
|
|
42
|
+
export declare function requestWithoutTargetActorError(browser: Browser, requestType: string): string;
|
|
43
|
+
export declare function connectionClosedError(browser: Browser): string;
|
|
44
|
+
export declare function targetActorHasActiveRequestError(browser: Browser, targetActor: string): string;
|
|
45
|
+
export declare function parsingPacketError(browser: Browser, error: unknown): string;
|
|
46
|
+
export declare function messageWithoutSenderError(browser: Browser, message: {
|
|
47
|
+
from?: string;
|
|
48
|
+
type?: string;
|
|
49
|
+
error?: unknown;
|
|
50
|
+
}): string;
|
|
51
|
+
export declare function unexpectedMessageReceivedError(browser: Browser, message: string): string;
|
|
52
|
+
export declare function isUsingStartingUrl(browser: Browser, value: unknown): string;
|
|
53
|
+
export declare function profileFallbackWarning(browser: Browser, reason: string): string;
|
|
54
|
+
export declare function pathPermissionError(browser: Browser, profilePath: string): string;
|
|
55
|
+
export declare function profileCreationError(browser: Browser, error: unknown): string;
|
|
56
|
+
export declare function chromeProcessExited(code: number): string;
|
|
57
|
+
export declare function chromeProcessError(error: unknown): string;
|
|
58
|
+
export declare function chromeFailedToSpawn(error: unknown): string;
|
|
59
|
+
export declare function chromeInitializingEnhancedReload(): string;
|
|
60
|
+
export declare function wslDockerDesktopRunnerDisabled(): string;
|
|
61
|
+
export declare function locatingBrowser(browser: Browser): string;
|
|
62
|
+
export declare function devChromeProfilePath(path: string): string;
|
|
63
|
+
export declare function usingChromiumRunner(browser: Browser): string;
|
|
64
|
+
export declare function usingFirefoxRunner(browser: Browser): string;
|
|
65
|
+
export declare function chromiumDryRunNotLaunching(): string;
|
|
66
|
+
export declare function chromiumDryRunBinary(path: string): string;
|
|
67
|
+
export declare function chromiumDryRunFlags(flags: string): string;
|
|
68
|
+
export declare function prettyPuppeteerInstallGuidance(browser: Browser, rawGuidance: string, cacheDir: string): string;
|
|
69
|
+
export declare function firefoxLaunchCalled(): string;
|
|
70
|
+
export declare function firefoxDetectionFailed(error: unknown): string;
|
|
71
|
+
export declare function firefoxBinaryArgsExtracted(args: string): string;
|
|
72
|
+
export declare function firefoxNoBinaryArgsFound(): string;
|
|
73
|
+
export declare function firefoxFailedToExtractProfilePath(): string;
|
|
74
|
+
export declare function firefoxFailedToStart(error: unknown): string;
|
|
75
|
+
export declare function firefoxDryRunNotLaunching(): string;
|
|
76
|
+
export declare function firefoxDryRunBinary(path: string): string;
|
|
77
|
+
export declare function firefoxDryRunConfig(cfg: string): string;
|
|
78
|
+
export declare function sourceInspectorInitialized(): string;
|
|
79
|
+
export declare function sourceInspectorInitializationFailed(error: string): string;
|
|
80
|
+
export declare function sourceInspectorChromeDebuggingRequired(port: number): string;
|
|
81
|
+
export declare function sourceInspectorFirefoxDebuggingRequired(port: number): string;
|
|
82
|
+
export declare function sourceInspectorWaitingForFirefox(): string;
|
|
83
|
+
export declare function firefoxRemoteDebuggingReady(): string;
|
|
84
|
+
export declare function sourceInspectorFirefoxNotReadyYet(retries: number, maxRetries: number): string;
|
|
85
|
+
export declare function sourceInspectorWaitingForChrome(): string;
|
|
86
|
+
export declare function chromeRemoteDebuggingReady(): string;
|
|
87
|
+
export declare function sourceInspectorChromeNotReadyYet(retries: number, maxRetries: number): string;
|
|
88
|
+
export declare function sourceInspectorOpeningUrl(url: string): string;
|
|
89
|
+
export declare function sourceInspectorWaitingForPageLoad(): string;
|
|
90
|
+
export declare function sourceInspectorCreatingTarget(): string;
|
|
91
|
+
export declare function sourceInspectorFindingExistingTarget(): string;
|
|
92
|
+
export declare function sourceInspectorUsingExistingTarget(targetId: string): string;
|
|
93
|
+
export declare function sourceInspectorTargetCreated(targetId: string): string;
|
|
94
|
+
export declare function sourceInspectorAttachingToTarget(): string;
|
|
95
|
+
export declare function sourceInspectorAttachedToTarget(sessionId: string): string;
|
|
96
|
+
export declare function sourceInspectorExtractingHTML(): string;
|
|
97
|
+
export declare function sourceInspectorHTMLExtractionComplete(): string;
|
|
98
|
+
export declare function sourceInspectorInspectionFailed(error: string): string;
|
|
99
|
+
export declare function sourceInspectorStartingWatchMode(): string;
|
|
100
|
+
export declare function sourceInspectorWatchModeActive(): string;
|
|
101
|
+
export declare function sourceInspectorWatchModeStopped(): string;
|
|
102
|
+
export declare function sourceInspectorCDPConnectionMaintained(): string;
|
|
103
|
+
export declare function sourceInspectorNoActiveSession(): string;
|
|
104
|
+
export declare function sourceInspectorReExtractingHTML(): string;
|
|
105
|
+
export declare function sourceInspectorAttemptingReconnection(): string;
|
|
106
|
+
export declare function sourceInspectorCannotReconnect(): string;
|
|
107
|
+
export declare function sourceInspectorReconnectingToTarget(): string;
|
|
108
|
+
export declare function sourceInspectorReconnectedToTarget(sessionId: string): string;
|
|
109
|
+
export declare function sourceInspectorReconnectionFailed(error: string): string;
|
|
110
|
+
export declare function sourceInspectorEnsuringNavigation(): string;
|
|
111
|
+
export declare function sourceInspectorEnablingPageDomain(): string;
|
|
112
|
+
export declare function sourceInspectorWaitingForContentScripts(): string;
|
|
113
|
+
export declare function sourceInspectorWaitingForContentScriptReinjection(): string;
|
|
114
|
+
export declare function sourceInspectorFileChanged(): string;
|
|
115
|
+
export declare function sourceInspectorHTMLUpdateFailed(error: string): string;
|
|
116
|
+
export declare function sourceInspectorCleanupComplete(): string;
|
|
117
|
+
export declare function sourceInspectorCleanupError(error: string): string;
|
|
118
|
+
export declare function sourceInspectorNotInitialized(): string;
|
|
119
|
+
export declare function sourceInspectorInvalidWebSocketServer(): string;
|
|
120
|
+
export declare function sourceInspectorUrlRequired(): string;
|
|
121
|
+
export declare function sourceInspectorWillInspect(url: string): string;
|
|
122
|
+
export declare function sourceInspectorSetupFailed(error: string): string;
|
|
123
|
+
export declare function sourceInspectorHTMLOutputHeader(): string;
|
|
124
|
+
export declare function sourceInspectorHTMLOutputTitle(title: string): string;
|
|
125
|
+
export declare function sourceInspectorHTMLOutputFooter(): string;
|
|
126
|
+
export declare function sourceInspectorClientNotInitialized(): string;
|
|
127
|
+
export declare function sourceInspectorNoTabActorAvailable(): string;
|
|
128
|
+
export declare function sourceInspectorNoTabTargetFound(): string;
|
|
129
|
+
export declare function sourceInspectorHtmlExtractFailed(): string;
|
|
130
|
+
export declare function cdpClientFoundTargets(count: number): string;
|
|
131
|
+
export declare function cdpClientTargetWebSocketUrlStored(): string;
|
|
132
|
+
export declare function cdpClientConnected(host: string, port: number): string;
|
|
133
|
+
export declare function cdpClientConnectionError(error: string): string;
|
|
134
|
+
export declare function cdpClientBrowserConnectionEstablished(): string;
|
|
135
|
+
export declare function cdpClientConnectionClosed(): string;
|
|
136
|
+
export declare function cdpClientMessageParseError(error: string): string;
|
|
137
|
+
export declare function cdpClientPageLoadEventFired(): string;
|
|
138
|
+
export declare function cdpClientLoadEventTimeout(): string;
|
|
139
|
+
export declare function cdpClientTestingEvaluation(): string;
|
|
140
|
+
export declare function cdpClientShadowDOMContentFound(found: boolean): string;
|
|
141
|
+
export declare function cdpClientShadowDOMContentLength(length: number): string;
|
|
142
|
+
export declare function cdpClientProcessingShadowDOM(): string;
|
|
143
|
+
export declare function cdpClientFinalHTMLWithShadowDOMLength(length: number): string;
|
|
144
|
+
export declare function cdpClientReturningMainHTML(): string;
|
|
145
|
+
export declare function cdpClientExtensionReloadFailed(extensionId: string, error: string): string;
|
|
146
|
+
export declare function cdpClientExtensionUnloadFailed(extensionId: string, error: string): string;
|
|
147
|
+
export declare function cdpClientExtensionInfoFailed(extensionId: string, error: string): string;
|
|
148
|
+
export declare function cdpClientExtensionLoadFailed(path: string, error: string): string;
|
|
149
|
+
export declare function firefoxRdpClientFoundTargets(count: number): string;
|
|
150
|
+
export declare function firefoxRdpClientUsingTarget(title: string, url: string): string;
|
|
151
|
+
export declare function firefoxRdpClientConnected(host: string, port: number): string;
|
|
152
|
+
export declare function firefoxRdpClientConnectionError(error: string): string;
|
|
153
|
+
export declare function firefoxRdpClientConnectionClosed(): string;
|
|
154
|
+
export declare function firefoxRdpClientNoSuitableTargets(): string;
|
|
155
|
+
export declare function firefoxRdpClientPageLoadEventFired(): string;
|
|
156
|
+
export declare function firefoxRdpClientLoadEventTimeout(): string;
|
|
157
|
+
export declare function firefoxRdpClientTestingEvaluation(): string;
|
|
158
|
+
export declare function firefoxRdpClientDocumentTitle(title: string): string;
|
|
159
|
+
export declare function firefoxRdpClientFailedToGetMainHTML(): string;
|
|
160
|
+
export declare function firefoxRdpClientFinalHTMLLength(length: number): string;
|
|
161
|
+
export interface DevManifestInfo {
|
|
162
|
+
name?: string;
|
|
163
|
+
version?: string;
|
|
164
|
+
hostPermissions?: string[];
|
|
165
|
+
permissions?: string[];
|
|
166
|
+
}
|
|
167
|
+
export interface DevClientManagementInfo {
|
|
168
|
+
name?: string;
|
|
169
|
+
version?: string;
|
|
170
|
+
}
|
|
171
|
+
export interface DevClientMessage {
|
|
172
|
+
data?: {
|
|
173
|
+
id?: string;
|
|
174
|
+
management?: DevClientManagementInfo;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
export declare function runningInDevelopment(manifest: DevManifestInfo, browser: BrowserType, message: DevClientMessage, browserVersionLine?: string, updateSuffix?: string, opts?: {
|
|
178
|
+
includeExtensionId?: boolean;
|
|
179
|
+
runLabel?: string;
|
|
180
|
+
}): string;
|
|
181
|
+
export declare function emptyLine(): string;
|
|
182
|
+
export declare function separatorLine(): string;
|
|
183
|
+
export declare function devChromiumDebugPort(finalPort: number, requestedPort: number): string;
|
|
184
|
+
export declare function devFirefoxDebugPort(finalPort: number, requestedPort: number): string;
|
|
185
|
+
export declare function devFirefoxProfilePath(profilePath: string): string;
|
|
186
|
+
export declare function unifiedLogLine(head: string, message: string): string;
|
|
187
|
+
export declare function devHtmlSampleRetry(sample: string): string;
|
|
188
|
+
export declare function devHtmlSampleLate(sample: string): string;
|
|
189
|
+
export declare function devSvelteProbeDetected(probe: string): string;
|
|
190
|
+
export declare function cdpUnifiedExtensionLog(ts: string, payload: unknown): string;
|
|
191
|
+
export declare function firefoxInspectSourceNonFatal(message: string): string;
|
|
192
|
+
export declare function browserPluginFailedToLoad(browser: string, error: unknown): string;
|
|
193
|
+
export declare function unsupportedBrowser(browser: string): string;
|
|
194
|
+
export declare function browserRunnerError(body: string): string;
|
|
195
|
+
export declare function requireChromiumBinaryForChromiumBased(): string;
|
|
196
|
+
export declare function requireGeckoBinaryForGeckoBased(): string;
|
|
197
|
+
export declare function invalidChromiumBinaryPath(p: string): string;
|
|
198
|
+
export declare function invalidGeckoBinaryPath(p: string): string;
|
|
199
|
+
export declare function firefoxDetectedFlatpak(): string;
|
|
200
|
+
export declare function firefoxDetectedSnap(): string;
|
|
201
|
+
export declare function firefoxDetectedTraditional(path: string): string;
|
|
202
|
+
export declare function firefoxDetectedCustom(path: string): string;
|
|
203
|
+
export declare function firefoxUsingFlatpakWithSandbox(): string;
|
|
204
|
+
export declare function firefoxVersion(version: string): string;
|
|
205
|
+
export declare function rdpInvalidRequestPayload(): string;
|
|
206
|
+
export declare function chromiumDeveloperModeGuidance(browser?: BrowserType): string;
|
|
207
|
+
export declare function chromiumHardReloadFailed(browser?: BrowserType): string;
|
|
208
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CompilationLike } from '../browsers-types';
|
|
2
|
+
export declare function getCompilationOutputPath(compilation: CompilationLike): string;
|
|
3
|
+
export declare function computeBinariesBaseDir(compilation: CompilationLike): string;
|
|
4
|
+
export declare function managedBrowserCacheEnv(cacheRoot: string, browser: 'chrome' | 'chromium' | 'firefox' | 'edge' | 'chromium-based' | 'gecko-based' | 'firefox-based'): Record<string, string>;
|
|
5
|
+
export declare function resolveFromBinaries(compilation: CompilationLike, browser: 'chrome' | 'chromium' | 'firefox' | 'edge'): string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ready(mode: 'development' | 'production', browser: string): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BrowserConfig } from '../browsers-types';
|
|
2
|
+
import type { PluginInterface } from '../browsers-types';
|
|
3
|
+
export declare const sharedBrowserRuntimeOptionKeys: readonly ["extension", "browser", "noOpen", "browserFlags", "excludeBrowserFlags", "profile", "preferences", "startingUrl", "instanceId", "port", "source", "watchSource", "sourceFormat", "sourceSummary", "sourceMeta", "sourceProbe", "sourceTree", "sourceConsole", "sourceDom", "sourceMaxBytes", "sourceRedact", "sourceIncludeShadow", "sourceDiff", "dryRun", "logLevel", "logContexts", "logFormat", "logTimestamps", "logColor", "logUrl", "logTab"];
|
|
4
|
+
export type SharedBrowserRuntimeOptions = Pick<PluginInterface, (typeof sharedBrowserRuntimeOptionKeys)[number]>;
|
|
5
|
+
export declare function pickSharedBrowserRuntimeOptions(options: SharedBrowserRuntimeOptions): SharedBrowserRuntimeOptions;
|
|
6
|
+
export type BrowserLaunchRequestSource = Pick<PluginInterface, 'browser' | 'browserFlags' | 'excludeBrowserFlags' | 'profile' | 'preferences' | 'startingUrl' | 'port'>;
|
|
7
|
+
export type BrowserLaunchRequest = Pick<PluginInterface & BrowserConfig, 'browser' | 'browserFlags' | 'excludeBrowserFlags' | 'profile' | 'preferences' | 'startingUrl' | 'port'> & {
|
|
8
|
+
mode: 'development' | 'production' | 'none';
|
|
9
|
+
};
|
|
10
|
+
export declare function buildBrowserLaunchRequest<T extends object = {}>(options: BrowserLaunchRequestSource, mode: 'development' | 'production' | 'none', extras?: T): BrowserLaunchRequest & T;
|
|
11
|
+
export declare function toExtensionLoadList(extension: PluginInterface['extension']): string[];
|
|
12
|
+
export declare function publishUserExtensionRoot(extension: PluginInterface['extension'], setExtensionRoot?: (root?: string) => void): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function shortInstanceId(instanceId?: string): string;
|
|
2
|
+
export declare function instanceOffsetFromId(instanceId?: string): number;
|
|
3
|
+
export declare function deriveDebugPortWithInstance(optionPort?: number | string, instanceId?: string): number;
|
|
4
|
+
export declare function calculateDebugPort(portFromConfig?: number | string, devServerPort?: number, defaultPort?: number): number;
|
|
5
|
+
export declare function filterBrowserFlags(defaultFlags: string[], excludeFlags?: string[]): string[];
|
|
6
|
+
export declare function findAvailablePortNear(startPort: number, maxAttempts?: number, host?: string): Promise<number>;
|
|
7
|
+
export declare function prepareChromiumProfileForLaunch(profilePath: string): {
|
|
8
|
+
removedArtifacts: string[];
|
|
9
|
+
};
|
|
10
|
+
export declare function markManagedEphemeralProfile(profilePath: string): void;
|
|
11
|
+
export declare function cleanupOldTempProfiles(baseDir: string, excludeBasename: string | undefined, maxAgeHours?: number): void;
|
|
@@ -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
|
+
}
|