extension 4.1.21 → 4.1.23
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/dist/{84.cjs → 597.cjs} +78 -1
- package/dist/browsers.cjs +294 -33
- package/dist/cli.cjs +410 -37
- package/dist/extension/browsers/browsers-lib/messages.d.ts +1 -1
- package/dist/extension/browsers/browsers-lib/process-teardown.d.ts +3 -0
- package/dist/extension/browsers/browsers-lib/ready-stamp.d.ts +1 -0
- package/dist/extension/browsers/browsers-lib/resolve-live-pid.d.ts +25 -0
- package/dist/extension/browsers/browsers-types.d.ts +1 -1
- package/dist/extension/browsers/run-chromium/cdp/cdp-extension-controller/index.d.ts +2 -0
- package/dist/extension/browsers/run-chromium/cdp/ensure-developer-mode.d.ts +12 -0
- package/dist/extension/browsers/run-firefox/firefox-launch/index.d.ts +9 -0
- package/dist/extension/browsers/run-firefox/firefox-launch/process-handlers.d.ts +1 -1
- package/dist/extension/helpers/messages.d.ts +1 -0
- package/dist/extension/helpers/messaging.d.ts +1 -0
- package/dist/extension/helpers/project-cli-version.d.ts +26 -0
- package/dist/extension/helpers/template-catalog.d.ts +1 -1
- package/dist/extension/helpers/template-corpus.generated.d.ts +1 -1
- package/package.json +5 -5
|
@@ -120,7 +120,7 @@ export interface DevClientMessage {
|
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
122
|
export declare function collapseHomeDirInCardValue(value: string): string;
|
|
123
|
-
export declare function binaryProvenanceNote(provenance?: 'managed' | 'pinned' | 'system' | 'snapshot'): string;
|
|
123
|
+
export declare function binaryProvenanceNote(provenance?: 'managed' | 'pinned' | 'system' | 'snapshot', browser?: BrowserType | string): string;
|
|
124
124
|
export declare function runningInDevelopment(manifest: DevManifestInfo, browser: BrowserType, message: DevClientMessage, browserVersionLine?: string, updateSuffix?: string, opts?: {
|
|
125
125
|
includeExtensionId?: boolean;
|
|
126
126
|
runLabel?: string;
|
|
@@ -2,6 +2,9 @@ import { type ChildProcess } from 'node:child_process';
|
|
|
2
2
|
import type { BrowserType } from '../browsers-types.js';
|
|
3
3
|
export declare const FORCE_KILL_GRACE_MS = 5000;
|
|
4
4
|
export declare function wasTerminatedByUs(child: ChildProcess | null): boolean;
|
|
5
|
+
export declare function wasPidTerminatedByUs(pid: number | null | undefined): boolean;
|
|
6
|
+
export declare function gracefulTerminatePid(pid: number | null | undefined, browser: BrowserType): void;
|
|
7
|
+
export declare function forceKillPidOnExit(pid: number | null | undefined, browser: BrowserType): void;
|
|
5
8
|
export declare function gracefulTerminateChild(child: ChildProcess | null, browser: BrowserType): void;
|
|
6
9
|
export declare function forceKillChildOnExit(child: ChildProcess | null, browser: BrowserType): void;
|
|
7
10
|
export declare function isBenignSocketTeardown(value: unknown): boolean;
|
|
@@ -2,6 +2,7 @@ export declare function stampReadyRdpPort(extensionOutputPath: string | undefine
|
|
|
2
2
|
export declare function stampReadyBrowserLaunch(extensionOutputPath: string | undefined, details: {
|
|
3
3
|
profilePath?: string;
|
|
4
4
|
browserPid?: number;
|
|
5
|
+
launcherPid?: number;
|
|
5
6
|
extensionId?: string;
|
|
6
7
|
binary?: string;
|
|
7
8
|
binaryProvenance?: 'managed' | 'pinned' | 'system' | 'snapshot';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface ProcessRow {
|
|
2
|
+
pid: number;
|
|
3
|
+
ppid: number;
|
|
4
|
+
command: string;
|
|
5
|
+
}
|
|
6
|
+
export type ProcessLister = () => ProcessRow[];
|
|
7
|
+
export declare function parseProcessRows(output: string): ProcessRow[];
|
|
8
|
+
export declare function listProcesses(platform?: NodeJS.Platform): ProcessRow[];
|
|
9
|
+
export declare function executableOf(command: string): string;
|
|
10
|
+
export declare function findLiveBrowserPid(input: {
|
|
11
|
+
profilePath: string;
|
|
12
|
+
binary: string;
|
|
13
|
+
launcherPid?: number;
|
|
14
|
+
rows: ProcessRow[];
|
|
15
|
+
}): number | null;
|
|
16
|
+
export declare function isPidAlive(pid: number | null | undefined): boolean;
|
|
17
|
+
export declare function resolveLiveBrowserPid(input: {
|
|
18
|
+
profilePath: string;
|
|
19
|
+
binary: string;
|
|
20
|
+
launcherPid?: number;
|
|
21
|
+
list?: ProcessLister;
|
|
22
|
+
attempts?: number;
|
|
23
|
+
intervalMs?: number;
|
|
24
|
+
sleep?: (ms: number) => Promise<void>;
|
|
25
|
+
}): Promise<number | null>;
|
|
@@ -29,7 +29,7 @@ export interface BrowserConfig {
|
|
|
29
29
|
browserFlags: string[];
|
|
30
30
|
startingUrl: string | undefined;
|
|
31
31
|
}
|
|
32
|
-
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' | '--disable-features=DisableLoadExtensionCommandLineSwitch' | '--disable-features=ExtensionDisableUnsupportedDeveloper' | '--enable-unsafe-extension-debugging' | '--silent-debugger-extension-api';
|
|
32
|
+
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' | '--disable-features=DisableLoadExtensionCommandLineSwitch' | '--disable-features=ExtensionDisableUnsupportedDeveloper' | '--disable-features=SafetyHubExtensionsOffStoreTrigger' | '--enable-unsafe-extension-debugging' | '--silent-debugger-extension-api';
|
|
33
33
|
export interface PluginOptions {
|
|
34
34
|
/**
|
|
35
35
|
* @default false
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Readable, Writable } from 'node:stream';
|
|
2
2
|
import type { BrowserLogSink } from '../../../browsers-types.js';
|
|
3
3
|
import type { CdpProtocolMessage } from '../../chromium-types.js';
|
|
4
|
+
import { type DeveloperModeOutcome } from '../ensure-developer-mode.js';
|
|
4
5
|
import { type LoadUnpackedOutcome } from './ensure.js';
|
|
5
6
|
interface ExtensionInfoResult {
|
|
6
7
|
extensionId: string;
|
|
@@ -29,6 +30,7 @@ export declare class CDPExtensionController {
|
|
|
29
30
|
logSink?: BrowserLogSink;
|
|
30
31
|
});
|
|
31
32
|
connect(): Promise<void>;
|
|
33
|
+
ensureDeveloperMode(): Promise<DeveloperModeOutcome>;
|
|
32
34
|
openTab(url: string): Promise<void>;
|
|
33
35
|
closeSelfOpenedTabs(): Promise<number>;
|
|
34
36
|
verifyGuestLoaded(): Promise<LoadUnpackedOutcome>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type DeveloperModeOutcome = 'already-on' | 'enabled' | 'skipped' | 'unavailable';
|
|
2
|
+
export interface DeveloperModeTransport {
|
|
3
|
+
sendCommand(method: string, params?: Record<string, unknown>, sessionId?: string): Promise<unknown>;
|
|
4
|
+
}
|
|
5
|
+
export declare function developerModeFromProfile(profilePath: string): boolean;
|
|
6
|
+
export declare function developerModeFlipIsSafe(browserArgs: string[]): boolean;
|
|
7
|
+
export declare function ensureDeveloperMode(options: {
|
|
8
|
+
transport: DeveloperModeTransport;
|
|
9
|
+
attempts?: number;
|
|
10
|
+
delayMs?: number;
|
|
11
|
+
sleep?: (ms: number) => Promise<void>;
|
|
12
|
+
}): Promise<DeveloperModeOutcome>;
|
|
@@ -18,6 +18,10 @@ export declare class FirefoxLaunchPlugin {
|
|
|
18
18
|
private child;
|
|
19
19
|
private watchTimeout?;
|
|
20
20
|
private extensionOutputPath?;
|
|
21
|
+
private livePid;
|
|
22
|
+
private liveExitWatcher?;
|
|
23
|
+
private browserGone;
|
|
24
|
+
private disposeProcessHandlers?;
|
|
21
25
|
constructor(host: FirefoxPluginRuntime, ctx: FirefoxContext);
|
|
22
26
|
runOnce(compilation: CompilationLike, options: LaunchOptions): Promise<void>;
|
|
23
27
|
apply(compiler: unknown): void;
|
|
@@ -27,6 +31,11 @@ export declare class FirefoxLaunchPlugin {
|
|
|
27
31
|
private spawnFirefoxChild;
|
|
28
32
|
private pipeChildOutput;
|
|
29
33
|
private wireChildLifecycle;
|
|
34
|
+
private onBrowserGone;
|
|
35
|
+
private trackLiveBrowserPid;
|
|
36
|
+
private adoptHandedOffBrowser;
|
|
37
|
+
private adoptLivePid;
|
|
38
|
+
private watchLivePidExit;
|
|
30
39
|
private retryAddonInstall;
|
|
31
40
|
private reportAddonLoadRefused;
|
|
32
41
|
private cleanupInstance;
|
|
@@ -2,4 +2,4 @@ import type { ChildProcess } from 'node:child_process';
|
|
|
2
2
|
export type FirefoxBrowserKind = 'firefox' | 'chrome' | 'edge' | 'chromium-based';
|
|
3
3
|
export declare function __activeFirefoxInstanceCount(): number;
|
|
4
4
|
export declare function __resetFirefoxProcessHandlersForTest(): void;
|
|
5
|
-
export declare function setupFirefoxProcessHandlers(browser: FirefoxBrowserKind, childRef: () => ChildProcess | null, cleanupInstance: () => Promise<void
|
|
5
|
+
export declare function setupFirefoxProcessHandlers(browser: FirefoxBrowserKind, childRef: () => ChildProcess | null, cleanupInstance: () => Promise<void>, livePidRef?: () => number | null): () => void;
|
|
@@ -195,6 +195,7 @@ export declare const COMMANDS: readonly CommandSpec[];
|
|
|
195
195
|
export declare function commandSpec(name: CommandName): CommandSpec;
|
|
196
196
|
export declare const commandDescriptions: Record<CommandName, string>;
|
|
197
197
|
export declare function availableCommandsBlock(): string;
|
|
198
|
+
export declare function projectCliVersionMismatch(running: string, declared: string, range: string, installCommand: string): string;
|
|
198
199
|
export declare function unhandledError(err: unknown): string;
|
|
199
200
|
export declare function updateFailed(err: unknown): string;
|
|
200
201
|
export declare function checkUpdates(packageJson: Record<string, unknown>, update: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type Channel = 'info' | 'success' | 'warn' | 'error' | 'debug';
|
|
2
2
|
export declare function isDebug(): boolean;
|
|
3
3
|
export declare function prefix(type: Channel): string;
|
|
4
|
+
export declare function hasChannelPrefix(text: string): boolean;
|
|
4
5
|
export declare function isMachineOutput(): boolean;
|
|
5
6
|
export declare function humanLine(...parts: unknown[]): void;
|
|
6
7
|
export declare function humanWarn(...parts: unknown[]): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const CLI_PACKAGES: readonly ['extension', 'extension-develop'];
|
|
2
|
+
export declare function installCommandFor(files: string[]): string;
|
|
3
|
+
export interface ProjectManifest {
|
|
4
|
+
dependencies?: Record<string, string>;
|
|
5
|
+
devDependencies?: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
export interface DeclaredCli {
|
|
8
|
+
name: string;
|
|
9
|
+
range: string;
|
|
10
|
+
}
|
|
11
|
+
export interface VersionMismatch {
|
|
12
|
+
declared: string;
|
|
13
|
+
range: string;
|
|
14
|
+
running: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function declaredCliDependency(manifest: ProjectManifest | null): DeclaredCli | null;
|
|
17
|
+
export declare function isComparableRange(range: string): boolean;
|
|
18
|
+
export declare function versionMismatch(input: {
|
|
19
|
+
manifest: ProjectManifest | null;
|
|
20
|
+
running: string;
|
|
21
|
+
}): VersionMismatch | null;
|
|
22
|
+
export declare function readProjectManifest(projectPath: string): ProjectManifest | null;
|
|
23
|
+
export interface ProjectCliVersionCheck extends VersionMismatch {
|
|
24
|
+
command: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function checkProjectCliVersion(projectPath: string, running: string): ProjectCliVersionCheck | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const DEFAULT_TEMPLATE = "typescript";
|
|
2
2
|
export declare const BUNDLED_TEMPLATES: readonly string[];
|
|
3
|
-
export declare const TEMPLATE_CATALOG_URL = "https://github.com/extension-js/examples/tree/
|
|
3
|
+
export declare const TEMPLATE_CATALOG_URL = "https://github.com/extension-js/examples/tree/f8087f012cf195cba9aa2e3c32fd5a6729da33f0/examples";
|
|
4
4
|
export interface TemplateGroup {
|
|
5
5
|
title: string;
|
|
6
6
|
summary: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const TEMPLATE_CORPUS_REPO = "extension-js/examples";
|
|
2
|
-
export declare const TEMPLATE_CORPUS_REF = "
|
|
2
|
+
export declare const TEMPLATE_CORPUS_REF = "f8087f012cf195cba9aa2e3c32fd5a6729da33f0";
|
|
3
3
|
export declare const TEMPLATE_CORPUS_SLUGS: readonly string[];
|
package/package.json
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"extension": "./bin/extension.cjs"
|
|
39
39
|
},
|
|
40
40
|
"name": "extension",
|
|
41
|
-
"version": "4.1.
|
|
41
|
+
"version": "4.1.23",
|
|
42
42
|
"description": "The cross-browser extension framework. Build Chrome, Edge, Firefox, and Safari extensions with no build configuration.",
|
|
43
43
|
"homepage": "https://extension.js.org/",
|
|
44
44
|
"bugs": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"registry": "https://registry.npmjs.org"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
|
-
"pretest": "pnpm run compile",
|
|
57
|
+
"pretest": "node ../../scripts/ensure-workspace-deps.mjs && pnpm run compile",
|
|
58
58
|
"prepublishOnly": "pnpm run compile",
|
|
59
59
|
"compile": "rslib build",
|
|
60
60
|
"watch": "rslib build --watch",
|
|
@@ -105,9 +105,9 @@
|
|
|
105
105
|
"vivaldi-location2": "2.1.1",
|
|
106
106
|
"waterfox-location": "2.1.1",
|
|
107
107
|
"yandex-location": "2.1.1",
|
|
108
|
-
"extension-create": "4.1.
|
|
109
|
-
"extension-develop": "4.1.
|
|
110
|
-
"extension-install": "4.1.
|
|
108
|
+
"extension-create": "4.1.23",
|
|
109
|
+
"extension-develop": "4.1.23",
|
|
110
|
+
"extension-install": "4.1.23",
|
|
111
111
|
"commander": "^15.0.0",
|
|
112
112
|
"pintor": "0.3.0",
|
|
113
113
|
"semver": "^7.7.3",
|