extension 4.1.37 → 4.1.38
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 +18 -5
- package/dist/cli.cjs +21 -25
- package/dist/extension/browsers/run-emulator/index.d.ts +3 -2
- package/dist/extension/config-types.d.ts +22 -6
- package/dist/extension/helpers/emulator-session.d.ts +2 -2
- package/dist/extension/helpers/template-catalog.d.ts +1 -1
- package/dist/extension/helpers/template-corpus.generated.d.ts +1 -1
- package/dist/extension/helpers/vendors.d.ts +0 -2
- package/package.json +4 -4
package/dist/browsers.cjs
CHANGED
|
@@ -3027,12 +3027,20 @@ var __webpack_modules__ = {
|
|
|
3027
3027
|
const report = await response.json();
|
|
3028
3028
|
return report && 'held' === report.hold ? 'held' : 'open';
|
|
3029
3029
|
} catch {
|
|
3030
|
-
return '
|
|
3030
|
+
return 'unreachable';
|
|
3031
3031
|
} finally{
|
|
3032
3032
|
clearTimeout(timer);
|
|
3033
3033
|
}
|
|
3034
3034
|
}
|
|
3035
|
-
function
|
|
3035
|
+
function engineOriginName(viewerUrl) {
|
|
3036
|
+
try {
|
|
3037
|
+
return new URL(viewerUrl).origin;
|
|
3038
|
+
} catch {
|
|
3039
|
+
return viewerUrl;
|
|
3040
|
+
}
|
|
3041
|
+
}
|
|
3042
|
+
function engineOriginLine(verdict, viewerUrl) {
|
|
3043
|
+
if ('unreachable' === verdict) return `${(0, messaging.Pl)('warn')} the emulated Chromium origin ${engineOriginName(viewerUrl)} did not answer, so there is no page to open. Check your connection, then run extension dev again, or run this project with --browser=chrome.`;
|
|
3036
3044
|
if ('held' === verdict) return `${(0, messaging.Pl)('warn')} emulated Chromium is not open to the public yet, so this address answers 503 until it is. Run this project with --browser=chrome in the meantime.`;
|
|
3037
3045
|
if ('throttled' === verdict) return `${(0, messaging.Pl)('warn')} the emulated Chromium origin is rate limiting this address (HTTP 429). Wait a minute, then run extension dev again, or run this project with --browser=chrome.`;
|
|
3038
3046
|
return null;
|
|
@@ -3058,7 +3066,7 @@ var __webpack_modules__ = {
|
|
|
3058
3066
|
console.log(emulatorViewerUrlLine(url));
|
|
3059
3067
|
const willOpen = !opts.noOpen && !opts.dryRun;
|
|
3060
3068
|
const verdict = willOpen ? await probe(url) : 'unknown';
|
|
3061
|
-
const originLine = engineOriginLine(verdict);
|
|
3069
|
+
const originLine = engineOriginLine(verdict, url);
|
|
3062
3070
|
if (originLine) console.warn(originLine);
|
|
3063
3071
|
if (willOpen && !originLine) opener(url);
|
|
3064
3072
|
const logsRequested = Boolean(opts.logLevel && 'off' !== opts.logLevel);
|
|
@@ -10167,6 +10175,10 @@ function describeButton(b) {
|
|
|
10167
10175
|
};
|
|
10168
10176
|
},
|
|
10169
10177
|
"./helpers/vendors.ts" () {
|
|
10178
|
+
const EMULATOR_BROWSER_TARGET = 'chromium-emulator';
|
|
10179
|
+
function isEmulatorVendor(value) {
|
|
10180
|
+
return value === EMULATOR_BROWSER_TARGET;
|
|
10181
|
+
}
|
|
10170
10182
|
function isSafariVendor(value) {
|
|
10171
10183
|
return 'safari' === value || 'webkit-based' === value;
|
|
10172
10184
|
}
|
|
@@ -10187,11 +10199,12 @@ function describeButton(b) {
|
|
|
10187
10199
|
'gecko-based',
|
|
10188
10200
|
'firefox-based',
|
|
10189
10201
|
'safari',
|
|
10190
|
-
'webkit-based'
|
|
10202
|
+
'webkit-based',
|
|
10203
|
+
EMULATOR_BROWSER_TARGET
|
|
10191
10204
|
];
|
|
10192
10205
|
SUPPORTED_BROWSER_TARGETS.join(' | ');
|
|
10193
10206
|
"chrome | chromium | edge | firefox | safari";
|
|
10194
|
-
SUPPORTED_BROWSER_TARGETS.filter((target)=>!isSafariVendor(target)).join(' | ');
|
|
10207
|
+
SUPPORTED_BROWSER_TARGETS.filter((target)=>!isSafariVendor(target) && !isEmulatorVendor(target)).join(' | ');
|
|
10195
10208
|
const MANAGED_INSTALL_TARGETS = [
|
|
10196
10209
|
'chrome',
|
|
10197
10210
|
'chromium',
|
package/dist/cli.cjs
CHANGED
|
@@ -3029,12 +3029,20 @@ var __webpack_modules__ = {
|
|
|
3029
3029
|
const report = await response.json();
|
|
3030
3030
|
return report && 'held' === report.hold ? 'held' : 'open';
|
|
3031
3031
|
} catch {
|
|
3032
|
-
return '
|
|
3032
|
+
return 'unreachable';
|
|
3033
3033
|
} finally{
|
|
3034
3034
|
clearTimeout(timer);
|
|
3035
3035
|
}
|
|
3036
3036
|
}
|
|
3037
|
-
function
|
|
3037
|
+
function engineOriginName(viewerUrl) {
|
|
3038
|
+
try {
|
|
3039
|
+
return new URL(viewerUrl).origin;
|
|
3040
|
+
} catch {
|
|
3041
|
+
return viewerUrl;
|
|
3042
|
+
}
|
|
3043
|
+
}
|
|
3044
|
+
function engineOriginLine(verdict, viewerUrl) {
|
|
3045
|
+
if ('unreachable' === verdict) return `${(0, messaging.Pl)('warn')} the emulated Chromium origin ${engineOriginName(viewerUrl)} did not answer, so there is no page to open. Check your connection, then run extension dev again, or run this project with --browser=chrome.`;
|
|
3038
3046
|
if ('held' === verdict) return `${(0, messaging.Pl)('warn')} emulated Chromium is not open to the public yet, so this address answers 503 until it is. Run this project with --browser=chrome in the meantime.`;
|
|
3039
3047
|
if ('throttled' === verdict) return `${(0, messaging.Pl)('warn')} the emulated Chromium origin is rate limiting this address (HTTP 429). Wait a minute, then run extension dev again, or run this project with --browser=chrome.`;
|
|
3040
3048
|
return null;
|
|
@@ -3060,7 +3068,7 @@ var __webpack_modules__ = {
|
|
|
3060
3068
|
console.log(emulatorViewerUrlLine(url));
|
|
3061
3069
|
const willOpen = !opts.noOpen && !opts.dryRun;
|
|
3062
3070
|
const verdict = willOpen ? await probe(url) : 'unknown';
|
|
3063
|
-
const originLine = engineOriginLine(verdict);
|
|
3071
|
+
const originLine = engineOriginLine(verdict, url);
|
|
3064
3072
|
if (originLine) console.warn(originLine);
|
|
3065
3073
|
if (willOpen && !originLine) opener(url);
|
|
3066
3074
|
const logsRequested = Boolean(opts.logLevel && 'off' !== opts.logLevel);
|
|
@@ -10280,8 +10288,8 @@ function describeButton(b) {
|
|
|
10280
10288
|
if ('logs' === command) return EMULATOR_LOGS_REFUSAL;
|
|
10281
10289
|
return `emulated Chromium runs in a web page and speaks no debugging protocol, so extension ${command} cannot reach it. Work in the page the dev server printed, or run this project with --browser=chrome.`;
|
|
10282
10290
|
}
|
|
10283
|
-
function isEmulatorSession(bridge, projectPath, browser
|
|
10284
|
-
if ((0, _vendors__rspack_import_0.CM)(browser)
|
|
10291
|
+
function isEmulatorSession(bridge, projectPath, browser) {
|
|
10292
|
+
if ((0, _vendors__rspack_import_0.CM)(browser)) return true;
|
|
10285
10293
|
const reader = bridge?.readReadyContractDocument;
|
|
10286
10294
|
if ('function' != typeof reader) return false;
|
|
10287
10295
|
try {
|
|
@@ -10290,8 +10298,8 @@ function describeButton(b) {
|
|
|
10290
10298
|
return false;
|
|
10291
10299
|
}
|
|
10292
10300
|
}
|
|
10293
|
-
function emulatorSessionRefusal(bridge, projectPath, browser, command
|
|
10294
|
-
return isEmulatorSession(bridge, projectPath, browser
|
|
10301
|
+
function emulatorSessionRefusal(bridge, projectPath, browser, command) {
|
|
10302
|
+
return isEmulatorSession(bridge, projectPath, browser) ? emulatorRefusalFor(command) : null;
|
|
10295
10303
|
}
|
|
10296
10304
|
__webpack_require__.d(__webpack_exports__, {
|
|
10297
10305
|
MC: ()=>emulatorSessionRefusal
|
|
@@ -10621,10 +10629,6 @@ function describeButton(b) {
|
|
|
10621
10629
|
},
|
|
10622
10630
|
"./helpers/vendors.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
10623
10631
|
const EMULATOR_BROWSER_TARGET = 'chromium-emulator';
|
|
10624
|
-
function isEmulatorLaneEnabled(env = process.env) {
|
|
10625
|
-
const value = String(env.EXTENSION_EXPERIMENTAL_EMULATOR || '').trim().toLowerCase();
|
|
10626
|
-
return '1' === value || 'true' === value;
|
|
10627
|
-
}
|
|
10628
10632
|
function isEmulatorVendor(value) {
|
|
10629
10633
|
return value === EMULATOR_BROWSER_TARGET;
|
|
10630
10634
|
}
|
|
@@ -10648,19 +10652,12 @@ function describeButton(b) {
|
|
|
10648
10652
|
'gecko-based',
|
|
10649
10653
|
'firefox-based',
|
|
10650
10654
|
'safari',
|
|
10651
|
-
'webkit-based'
|
|
10655
|
+
'webkit-based',
|
|
10656
|
+
EMULATOR_BROWSER_TARGET
|
|
10652
10657
|
];
|
|
10653
10658
|
const BROWSER_TARGETS_HELP = SUPPORTED_BROWSER_TARGETS.join(' | ');
|
|
10654
|
-
function supportedBrowserTargets(env = process.env) {
|
|
10655
|
-
return isEmulatorLaneEnabled(env) ? [
|
|
10656
|
-
...SUPPORTED_BROWSER_TARGETS,
|
|
10657
|
-
EMULATOR_BROWSER_TARGET
|
|
10658
|
-
] : [
|
|
10659
|
-
...SUPPORTED_BROWSER_TARGETS
|
|
10660
|
-
];
|
|
10661
|
-
}
|
|
10662
10659
|
const SESSION_BROWSER_TARGETS_HELP = "chrome | chromium | edge | firefox | safari";
|
|
10663
|
-
const NO_SAFARI_BROWSER_TARGETS_HELP = SUPPORTED_BROWSER_TARGETS.filter((target)=>!isSafariVendor(target)).join(' | ');
|
|
10660
|
+
const NO_SAFARI_BROWSER_TARGETS_HELP = SUPPORTED_BROWSER_TARGETS.filter((target)=>!isSafariVendor(target) && !isEmulatorVendor(target)).join(' | ');
|
|
10664
10661
|
function parseOptionalBoolean(value) {
|
|
10665
10662
|
if (void 0 === value) return true;
|
|
10666
10663
|
const normalized = String(value).trim().toLowerCase();
|
|
@@ -10702,9 +10699,9 @@ function describeButton(b) {
|
|
|
10702
10699
|
...MANAGED_INSTALL_BINARIES
|
|
10703
10700
|
] : vendors(browser);
|
|
10704
10701
|
function validateVendors(vendorsList, onInvalid, options = {}) {
|
|
10705
|
-
const supported = false === options.allowEmulator ? [
|
|
10702
|
+
const supported = false === options.allowEmulator ? SUPPORTED_BROWSER_TARGETS.filter((target)=>!isEmulatorVendor(target)) : [
|
|
10706
10703
|
...SUPPORTED_BROWSER_TARGETS
|
|
10707
|
-
]
|
|
10704
|
+
];
|
|
10708
10705
|
for (const v of vendorsList)if (!supported.includes(v)) {
|
|
10709
10706
|
onInvalid(v, supported);
|
|
10710
10707
|
return false;
|
|
@@ -10734,7 +10731,6 @@ function describeButton(b) {
|
|
|
10734
10731
|
$q: ()=>isSafariVendor,
|
|
10735
10732
|
CM: ()=>isEmulatorVendor,
|
|
10736
10733
|
RY: ()=>firstNonManagedInstallTarget,
|
|
10737
|
-
hs: ()=>isEmulatorLaneEnabled,
|
|
10738
10734
|
sJ: ()=>parseOptionalBoolean,
|
|
10739
10735
|
sS: ()=>validateVendors
|
|
10740
10736
|
}, {
|
|
@@ -11466,7 +11462,7 @@ function describeButton(b) {
|
|
|
11466
11462
|
}
|
|
11467
11463
|
var messaging = __webpack_require__("./helpers/messaging.ts");
|
|
11468
11464
|
const TEMPLATE_CORPUS_REPO = 'extension-js/examples';
|
|
11469
|
-
const TEMPLATE_CORPUS_REF = '
|
|
11465
|
+
const TEMPLATE_CORPUS_REF = '4938dfdd46b37fb237ab19c4157d5a9d2f222ca8';
|
|
11470
11466
|
const TEMPLATE_CORPUS_SLUGS = [
|
|
11471
11467
|
'action',
|
|
11472
11468
|
'action-locales',
|
|
@@ -16,7 +16,7 @@ export declare function openCommandFor(url: string, platform?: NodeJS.Platform):
|
|
|
16
16
|
command: string;
|
|
17
17
|
args: string[];
|
|
18
18
|
};
|
|
19
|
-
export type EngineOriginVerdict = 'open' | 'held' | 'throttled' | 'unknown';
|
|
19
|
+
export type EngineOriginVerdict = 'open' | 'held' | 'throttled' | 'unreachable' | 'unknown';
|
|
20
20
|
export type OriginFetch = (url: string, init: {
|
|
21
21
|
signal: AbortSignal;
|
|
22
22
|
}) => Promise<{
|
|
@@ -25,6 +25,7 @@ export type OriginFetch = (url: string, init: {
|
|
|
25
25
|
}>;
|
|
26
26
|
export declare function engineVersionUrl(viewerUrl: string): string | null;
|
|
27
27
|
export declare function probeEngineOrigin(viewerUrl: string, fetchImpl?: OriginFetch, timeoutMs?: number): Promise<EngineOriginVerdict>;
|
|
28
|
-
export declare function
|
|
28
|
+
export declare function engineOriginName(viewerUrl: string): string;
|
|
29
|
+
export declare function engineOriginLine(verdict: EngineOriginVerdict, viewerUrl: string): string | null;
|
|
29
30
|
export declare function openInDefaultBrowser(url: string): void;
|
|
30
31
|
export declare function launchEmulator(opts: EmulatorLaunchOptions, opener?: UrlOpener, probe?: (url: string) => Promise<EngineOriginVerdict>): Promise<EmulatorController>;
|
|
@@ -72,16 +72,32 @@ export interface BrowserConfig extends BrowserLaunchConfig {
|
|
|
72
72
|
/**
|
|
73
73
|
* Asset categories the perf-budgets plugin recognizes. `shared` is the chunk
|
|
74
74
|
* every page that imports a framework or a common module loads. `public` is
|
|
75
|
-
* a file copied from the public folder as authored. `
|
|
76
|
-
*
|
|
77
|
-
*
|
|
75
|
+
* a file copied from the public folder as authored. `wasm` is a WebAssembly
|
|
76
|
+
* file only extension pages and workers fetch when they run it, such as an
|
|
77
|
+
* onnxruntime or ffmpeg core, which cannot be split and gets 32 MiB by
|
|
78
|
+
* default. `runtime` covers a WebAssembly file a content script or the
|
|
79
|
+
* service worker reaches, and root-level runtime helpers emitted outside a
|
|
80
|
+
* surface folder, 1 MiB by default.
|
|
78
81
|
*/
|
|
79
82
|
export type PerfBudgetCategory = 'content-script' | 'service-worker' | 'page' | 'shared' | 'public' | 'runtime' | 'wasm' | 'ignored';
|
|
80
83
|
/**
|
|
81
|
-
* Per-category asset size budgets (bytes) for compiling commands
|
|
82
|
-
*
|
|
84
|
+
* Per-category asset size budgets (bytes) for compiling commands, plus
|
|
85
|
+
* `ignore`, the output paths no budget applies to: exact paths as the
|
|
86
|
+
* warning prints them, or globs where `*` stays inside one folder and `**`
|
|
87
|
+
* spans folders. Set at the top level, or per command via
|
|
88
|
+
* `commands.dev|build.perfBudgets`.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* export default {
|
|
92
|
+
* perfBudgets: {
|
|
93
|
+
* wasm: 48 * 1024 * 1024,
|
|
94
|
+
* ignore: ['assets/ort-wasm-simd-threaded.asyncify.wasm']
|
|
95
|
+
* }
|
|
96
|
+
* }
|
|
83
97
|
*/
|
|
84
|
-
export type PerfBudgetsConfig = Partial<Record<PerfBudgetCategory, number
|
|
98
|
+
export type PerfBudgetsConfig = Partial<Record<PerfBudgetCategory, number>> & {
|
|
99
|
+
ignore?: string[];
|
|
100
|
+
};
|
|
85
101
|
/** `commands.dev` overrides. */
|
|
86
102
|
export interface DevCommandConfig extends BrowserLaunchConfig, UnifiedLoggerConfig {
|
|
87
103
|
browser?: BrowserType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
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
2
|
export declare function emulatorRefusalFor(command: string): string;
|
|
3
|
-
export declare function isEmulatorSession(bridge: unknown, projectPath: string, browser: string
|
|
4
|
-
export declare function emulatorSessionRefusal(bridge: unknown, projectPath: string, browser: string, command: string
|
|
3
|
+
export declare function isEmulatorSession(bridge: unknown, projectPath: string, browser: string): boolean;
|
|
4
|
+
export declare function emulatorSessionRefusal(bridge: unknown, projectPath: string, browser: string, command: string): string | 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/4938dfdd46b37fb237ab19c4157d5a9d2f222ca8/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 = "4938dfdd46b37fb237ab19c4157d5a9d2f222ca8";
|
|
3
3
|
export declare const TEMPLATE_CORPUS_SLUGS: readonly string[];
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export type Browser = 'chrome' | 'edge' | 'firefox' | 'chromium' | 'chromium-based' | 'gecko-based' | 'firefox-based' | 'safari' | 'webkit-based' | 'chromium-emulator';
|
|
2
2
|
export declare const EMULATOR_BROWSER_TARGET = "chromium-emulator";
|
|
3
|
-
export declare function isEmulatorLaneEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
4
3
|
export declare function isEmulatorVendor(value: unknown): boolean;
|
|
5
4
|
export declare function isSafariVendor(value: string): boolean;
|
|
6
5
|
export declare const SUPPORTED_BROWSER_TARGETS: string[];
|
|
7
6
|
export declare const BROWSER_TARGETS_HELP: string;
|
|
8
|
-
export declare function supportedBrowserTargets(env?: NodeJS.ProcessEnv): string[];
|
|
9
7
|
export declare const SESSION_BROWSER_TARGETS_HELP: string;
|
|
10
8
|
export declare const NO_SAFARI_BROWSER_TARGETS_HELP: string;
|
|
11
9
|
export declare function parseOptionalBoolean(value?: string): boolean;
|
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.38",
|
|
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
|
"funding": "https://github.com/sponsors/cezaraugusto",
|
|
@@ -104,9 +104,9 @@
|
|
|
104
104
|
"chromium-location": "2.1.2",
|
|
105
105
|
"commander": "^15.0.0",
|
|
106
106
|
"edge-location": "2.3.1",
|
|
107
|
-
"extension-create": "4.1.
|
|
108
|
-
"extension-develop": "4.1.
|
|
109
|
-
"extension-install": "4.1.
|
|
107
|
+
"extension-create": "4.1.38",
|
|
108
|
+
"extension-develop": "4.1.38",
|
|
109
|
+
"extension-install": "4.1.38",
|
|
110
110
|
"firefox-location2": "3.2.0",
|
|
111
111
|
"floorp-location": "1.0.0",
|
|
112
112
|
"librewolf-location": "1.2.1",
|