extension 4.1.25 → 4.1.27
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/browsers.cjs +360 -61
- package/dist/cli.cjs +513 -166
- package/dist/extension/browsers/browsers-lib/banner.d.ts +1 -0
- package/dist/extension/browsers/browsers-lib/browser-family.d.ts +2 -0
- package/dist/extension/browsers/browsers-lib/messages.d.ts +3 -1
- package/dist/extension/browsers/browsers-lib/output-binaries-resolver.d.ts +1 -1
- package/dist/extension/browsers/browsers-types.d.ts +1 -1
- package/dist/extension/browsers/index.d.ts +1 -0
- package/dist/extension/browsers/run-emulator/index.d.ts +30 -0
- package/dist/extension/browsers/run-firefox/firefox-launch/child-output.d.ts +11 -0
- package/dist/extension/browsers/run-firefox/firefox-launch/librewolf-overrides.d.ts +11 -0
- package/dist/extension/browsers/run-firefox/rdp/remote-firefox/firefox-utils.d.ts +2 -1
- package/dist/extension/config-types.d.ts +6 -1
- package/dist/extension/helpers/emulator-session.d.ts +4 -0
- package/dist/extension/helpers/messaging.d.ts +1 -0
- package/dist/extension/helpers/vendors.d.ts +8 -2
- package/package.json +15 -12
|
@@ -9,6 +9,7 @@ type HostPort = {
|
|
|
9
9
|
port?: number | string;
|
|
10
10
|
};
|
|
11
11
|
type BinaryProvenance = 'managed' | 'pinned' | 'system' | 'snapshot';
|
|
12
|
+
export declare function chromiumExtensionIdFromRegisteredPath(registeredPath: string, platform?: NodeJS.Platform): string;
|
|
12
13
|
export declare function expectedChromiumExtensionId(outPath: string): string;
|
|
13
14
|
export declare function expectedGeckoExtensionId(outPath: string): string;
|
|
14
15
|
export declare function printDevBannerOnce(opts: {
|
|
@@ -3,3 +3,5 @@ export declare const CHROMIUM_BROWSERS: ReadonlySet<string>;
|
|
|
3
3
|
export declare const FIREFOX_BROWSERS: ReadonlySet<string>;
|
|
4
4
|
export declare function isChromiumBrowser(browser: BrowserType | string): boolean;
|
|
5
5
|
export declare function isFirefoxBrowser(browser: BrowserType | string): boolean;
|
|
6
|
+
export declare const EMULATOR_BROWSERS: ReadonlySet<string>;
|
|
7
|
+
export declare function isEmulatorBrowser(browser: BrowserType | string): boolean;
|
|
@@ -11,6 +11,7 @@ export declare function bestEffortBannerPrintFailed(message: string): string;
|
|
|
11
11
|
export declare function firefoxRdpRuntimeCapabilitySummary(state: 'available' | 'unavailable'): string;
|
|
12
12
|
export declare function skippingBrowserLaunchDueToCompileErrors(): string;
|
|
13
13
|
export declare function browserNotInstalledError(browser: Browser, browserBinaryLocation: string): string;
|
|
14
|
+
export declare function geckoForkNotInstalled(browser: Browser, guidance: string): string;
|
|
14
15
|
export declare function usingManagedChromiumFamilyFallback(requestedBrowser: Browser, _fallbackBrowser: Browser, _binaryPath: string): string;
|
|
15
16
|
export declare function preferringSystemBrowserOverSnapshot(_systemBinary: string, _snapshotBinary: string): string;
|
|
16
17
|
export declare function mv2NotSupportedByChromium(extensionPath: string): string;
|
|
@@ -52,7 +53,8 @@ export declare function chromiumDryRunNotLaunching(): string;
|
|
|
52
53
|
export declare function chromiumDryRunBinary(path: string): string;
|
|
53
54
|
export declare function chromiumDryRunFlags(flags: string): string;
|
|
54
55
|
export declare function prettyPuppeteerInstallGuidance(browser: Browser, rawGuidance: string, cacheDir: string): string;
|
|
55
|
-
export declare function firefoxLaunchCalled(): string;
|
|
56
|
+
export declare function firefoxLaunchCalled(browser?: Browser | string): string;
|
|
57
|
+
export declare function librewolfRemoteDebuggingLocked(overridesPath: string): string;
|
|
56
58
|
export declare function firefoxBinaryArgsExtracted(args: string): string;
|
|
57
59
|
export declare function firefoxNoBinaryArgsFound(): string;
|
|
58
60
|
export declare function firefoxFailedToStart(error: unknown): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CompilationLike } from '../browsers-types.js';
|
|
2
2
|
export declare function getCompilationOutputPath(compilation: CompilationLike): string;
|
|
3
3
|
export declare function computeBinariesBaseDir(compilation: CompilationLike): string;
|
|
4
|
-
export declare function managedBrowserCacheEnv(cacheRoot: string, browser: 'chrome' | 'chromium' | 'firefox' | 'edge' | 'brave' | 'opera' | 'vivaldi' | 'yandex' | 'waterfox' | 'librewolf' | 'chromium-based' | 'gecko-based' | 'firefox-based' | 'safari' | 'webkit-based'): Record<string, string>;
|
|
4
|
+
export declare function managedBrowserCacheEnv(cacheRoot: string, browser: 'chrome' | 'chromium' | 'firefox' | 'edge' | 'brave' | 'opera' | 'vivaldi' | 'yandex' | 'waterfox' | 'librewolf' | 'zen' | 'floorp' | 'chromium-based' | 'gecko-based' | 'firefox-based' | 'safari' | 'webkit-based' | 'chromium-emulator'): Record<string, string>;
|
|
5
5
|
export declare function resolveFromBinaries(compilation: CompilationLike, browser: 'chrome' | 'chromium' | 'firefox' | 'edge'): string | null;
|
|
6
6
|
export declare function parseManagedBuildId(dirName: string): number[];
|
|
7
7
|
export declare function compareManagedBuildDirNames(a: string, b: string): number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type BrowserType = 'chrome' | 'edge' | 'firefox' | 'chromium' | 'brave' | 'opera' | 'vivaldi' | 'yandex' | 'waterfox' | 'librewolf' | 'chromium-based' | 'gecko-based' | 'firefox-based' | 'safari' | 'webkit-based';
|
|
1
|
+
export type BrowserType = 'chrome' | 'edge' | 'firefox' | 'chromium' | 'brave' | 'opera' | 'vivaldi' | 'yandex' | 'waterfox' | 'librewolf' | 'zen' | 'floorp' | 'chromium-based' | 'gecko-based' | 'firefox-based' | 'safari' | 'webkit-based' | 'chromium-emulator';
|
|
2
2
|
export interface CompilationLike {
|
|
3
3
|
options: {
|
|
4
4
|
mode?: string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface EmulatorLaunchOptions {
|
|
2
|
+
browser: string;
|
|
3
|
+
mode?: 'development' | 'production';
|
|
4
|
+
noOpen?: boolean;
|
|
5
|
+
dryRun?: boolean;
|
|
6
|
+
logLevel?: string;
|
|
7
|
+
emulatorViewerUrl?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface EmulatorController {
|
|
10
|
+
enableUnifiedLogging(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export type UrlOpener = (url: string) => void;
|
|
13
|
+
export declare function emulatorViewerUrlLine(url: string): string;
|
|
14
|
+
export declare function emulatorLogsLimitLine(): string;
|
|
15
|
+
export declare function openCommandFor(url: string, platform?: NodeJS.Platform): {
|
|
16
|
+
command: string;
|
|
17
|
+
args: string[];
|
|
18
|
+
};
|
|
19
|
+
export type EngineOriginVerdict = 'open' | 'held' | 'throttled' | 'unknown';
|
|
20
|
+
export type OriginFetch = (url: string, init: {
|
|
21
|
+
signal: AbortSignal;
|
|
22
|
+
}) => Promise<{
|
|
23
|
+
status: number;
|
|
24
|
+
json(): Promise<unknown>;
|
|
25
|
+
}>;
|
|
26
|
+
export declare function engineVersionUrl(viewerUrl: string): string | null;
|
|
27
|
+
export declare function probeEngineOrigin(viewerUrl: string, fetchImpl?: OriginFetch, timeoutMs?: number): Promise<EngineOriginVerdict>;
|
|
28
|
+
export declare function engineOriginLine(verdict: EngineOriginVerdict): string | null;
|
|
29
|
+
export declare function openInDefaultBrowser(url: string): void;
|
|
30
|
+
export declare function launchEmulator(opts: EmulatorLaunchOptions, opener?: UrlOpener, probe?: (url: string) => Promise<EngineOriginVerdict>): Promise<EmulatorController>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ChildProcess } from 'node:child_process';
|
|
2
|
+
import type { Writable } from 'node:stream';
|
|
3
|
+
type ChildStreams = Pick<ChildProcess, 'stdout' | 'stderr'>;
|
|
4
|
+
export declare function attachChildOutput(child: ChildStreams, opts: {
|
|
5
|
+
debug: boolean;
|
|
6
|
+
sinks?: {
|
|
7
|
+
stdout: Writable;
|
|
8
|
+
stderr: Writable;
|
|
9
|
+
};
|
|
10
|
+
}): void;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type FsLike = {
|
|
2
|
+
existsSync: (p: string) => boolean;
|
|
3
|
+
readFileSync: (p: string, encoding: 'utf-8') => string;
|
|
4
|
+
};
|
|
5
|
+
export declare const LIBREWOLF_REMOTE_DEBUGGING_LINES: string[];
|
|
6
|
+
export declare function librewolfOverridesCandidates(env: NodeJS.ProcessEnv, platform: NodeJS.Platform): string[];
|
|
7
|
+
export declare function librewolfRemoteDebuggingEnabled(fsLike: FsLike, env: NodeJS.ProcessEnv, platform: NodeJS.Platform): {
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
expectedPath: string;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { BrowserType } from '../../../browsers-types.js';
|
|
2
|
+
export declare function printRunningInDevelopmentSummary(candidateAddonPaths: string[], browser: BrowserType, extensionId?: string, browserVersionLine?: string, launchIdentity?: {
|
|
2
3
|
profilePath?: string;
|
|
3
4
|
binaryPath?: string;
|
|
4
5
|
binaryProvenance?: 'managed' | 'pinned' | 'system' | 'snapshot';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** A browser target accepted by Extension.js commands. */
|
|
2
|
-
export type BrowserType = 'chrome' | 'edge' | 'firefox' | 'chromium' | 'brave' | 'opera' | 'vivaldi' | 'yandex' | 'waterfox' | 'librewolf' | 'chromium-based' | 'gecko-based' | 'firefox-based' | 'safari' | 'webkit-based';
|
|
2
|
+
export type BrowserType = 'chrome' | 'edge' | 'firefox' | 'chromium' | 'brave' | 'opera' | 'vivaldi' | 'yandex' | 'waterfox' | 'librewolf' | 'zen' | 'floorp' | 'chromium-based' | 'gecko-based' | 'firefox-based' | 'safari' | 'webkit-based';
|
|
3
3
|
/**
|
|
4
4
|
* Companion extensions are "load-only" unpacked extension directories loaded
|
|
5
5
|
* alongside the user extension in `dev`/`preview`/`start` (and `build` for
|
|
@@ -97,6 +97,11 @@ export interface BuildCommandConfig {
|
|
|
97
97
|
* as warnings. Needs `addons-linter` installed. Defaults to `true`.
|
|
98
98
|
*/
|
|
99
99
|
addonLint?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Minify first-party code in production builds. Defaults to `true` for
|
|
102
|
+
* every target but `opera`, whose store reviews readable source only.
|
|
103
|
+
*/
|
|
104
|
+
minify?: boolean;
|
|
100
105
|
extensions?: CompanionExtensionsConfig;
|
|
101
106
|
transpilePackages?: string[];
|
|
102
107
|
perfBudgets?: PerfBudgetsConfig;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const EMULATOR_LOGS_REFUSAL = "emulated Chromium runs in a web page, so extension logs has nothing to attach to. Open your browser devtools on that page to read the console.";
|
|
2
|
+
export declare function emulatorRefusalFor(command: string): string;
|
|
3
|
+
export declare function isEmulatorSession(bridge: unknown, projectPath: string, browser: string, env?: NodeJS.ProcessEnv): boolean;
|
|
4
|
+
export declare function emulatorSessionRefusal(bridge: unknown, projectPath: string, browser: string, command: string, env?: NodeJS.ProcessEnv): string | null;
|
|
@@ -26,6 +26,7 @@ export interface CardInput {
|
|
|
26
26
|
}
|
|
27
27
|
export declare const MAX_CARD_ROWS = 3;
|
|
28
28
|
export declare function card(input?: CardInput): string;
|
|
29
|
+
export declare function browserDisplayName(browser: string): string;
|
|
29
30
|
export declare function browserRowValue(browser: string, versionLine?: string): string;
|
|
30
31
|
export declare function isCardKeyClaimed(key: string): boolean;
|
|
31
32
|
export declare function claimCardKey(key: string): boolean;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
export type Browser = 'chrome' | 'edge' | 'firefox' | 'chromium' | 'chromium-based' | 'gecko-based' | 'firefox-based' | 'safari' | 'webkit-based';
|
|
1
|
+
export type Browser = 'chrome' | 'edge' | 'firefox' | 'chromium' | 'chromium-based' | 'gecko-based' | 'firefox-based' | 'safari' | 'webkit-based' | 'chromium-emulator';
|
|
2
|
+
export declare const EMULATOR_BROWSER_TARGET = "chromium-emulator";
|
|
3
|
+
export declare function isEmulatorLaneEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
4
|
+
export declare function isEmulatorVendor(value: unknown): boolean;
|
|
2
5
|
export declare function isSafariVendor(value: string): boolean;
|
|
3
6
|
export declare const SUPPORTED_BROWSER_TARGETS: string[];
|
|
4
7
|
export declare const BROWSER_TARGETS_HELP: string;
|
|
8
|
+
export declare function supportedBrowserTargets(env?: NodeJS.ProcessEnv): string[];
|
|
5
9
|
export declare const SESSION_BROWSER_TARGETS_HELP: string;
|
|
6
10
|
export declare const NO_SAFARI_BROWSER_TARGETS_HELP: string;
|
|
7
11
|
export declare function parseOptionalBoolean(value?: string): boolean;
|
|
@@ -10,7 +14,9 @@ export declare const MANAGED_INSTALL_TARGETS: readonly ['chrome', 'chromium', 'e
|
|
|
10
14
|
export declare const MANAGED_INSTALL_TARGETS_HELP: string;
|
|
11
15
|
export declare const MANAGED_INSTALL_BINARIES: readonly ['chrome', 'chromium', 'edge', 'firefox'];
|
|
12
16
|
export declare const installTargets: (browser?: Browser | 'all') => string[];
|
|
13
|
-
export declare function validateVendors(vendorsList: string[], onInvalid: (invalid: string, supported: string[]) => void
|
|
17
|
+
export declare function validateVendors(vendorsList: string[], onInvalid: (invalid: string, supported: string[]) => void, options?: {
|
|
18
|
+
allowEmulator?: boolean;
|
|
19
|
+
}): boolean;
|
|
14
20
|
export declare function validateManagedInstallTargets(targetsList: string[], onInvalid: (invalid: string, supported: string[]) => void): boolean;
|
|
15
21
|
export type ManagedInstallTargetClass = 'managed' | 'not-installable' | 'unknown';
|
|
16
22
|
export declare function classifyManagedInstallTarget(name: string): ManagedInstallTargetClass;
|
package/package.json
CHANGED
|
@@ -38,9 +38,10 @@
|
|
|
38
38
|
"extension": "./bin/extension.cjs"
|
|
39
39
|
},
|
|
40
40
|
"name": "extension",
|
|
41
|
-
"version": "4.1.
|
|
41
|
+
"version": "4.1.27",
|
|
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
|
+
"funding": "https://github.com/sponsors/cezaraugusto",
|
|
44
45
|
"bugs": {
|
|
45
46
|
"url": "https://github.com/extension-js/extension.js/issues"
|
|
46
47
|
},
|
|
@@ -95,29 +96,31 @@
|
|
|
95
96
|
"cli"
|
|
96
97
|
],
|
|
97
98
|
"dependencies": {
|
|
99
|
+
"@types/chrome": "*",
|
|
100
|
+
"@types/node": "*",
|
|
101
|
+
"@types/webextension-polyfill": "*",
|
|
98
102
|
"brave-location": "3.1.1",
|
|
99
103
|
"chrome-location2": "4.1.1",
|
|
100
104
|
"chromium-location": "2.1.2",
|
|
105
|
+
"commander": "^15.0.0",
|
|
101
106
|
"edge-location": "2.3.1",
|
|
107
|
+
"extension-create": "4.1.27",
|
|
108
|
+
"extension-develop": "4.1.27",
|
|
109
|
+
"extension-install": "4.1.27",
|
|
102
110
|
"firefox-location2": "3.1.1",
|
|
111
|
+
"floorp-location": "1.0.0",
|
|
103
112
|
"librewolf-location": "1.2.1",
|
|
104
113
|
"opera-location2": "2.1.1",
|
|
105
|
-
"vivaldi-location2": "2.1.1",
|
|
106
|
-
"waterfox-location": "2.1.1",
|
|
107
|
-
"yandex-location": "2.1.1",
|
|
108
|
-
"extension-create": "4.1.25",
|
|
109
|
-
"extension-develop": "4.1.25",
|
|
110
|
-
"extension-install": "4.1.25",
|
|
111
|
-
"commander": "^15.0.0",
|
|
112
114
|
"pintor": "0.3.0",
|
|
113
115
|
"semver": "^7.7.3",
|
|
114
116
|
"unique-names-generator": "^4.7.1",
|
|
115
|
-
"ws": "^8.20.1",
|
|
116
117
|
"update-check": "^1.5.4",
|
|
118
|
+
"vivaldi-location2": "2.1.1",
|
|
119
|
+
"waterfox-location": "2.1.1",
|
|
120
|
+
"ws": "^8.20.1",
|
|
117
121
|
"wsl-support": "0.1.0",
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"@types/webextension-polyfill": "*"
|
|
122
|
+
"yandex-location": "2.1.1",
|
|
123
|
+
"zen-location": "1.0.0"
|
|
121
124
|
},
|
|
122
125
|
"devDependencies": {
|
|
123
126
|
"@rslib/core": "^1.0.0",
|