extension 4.0.22 → 4.0.24
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 +2 -0
- package/dist/49.cjs +47 -39
- package/dist/browsers.cjs +161 -103
- package/dist/cli.cjs +188 -107
- package/dist/extension/browsers/browsers-lib/banner.d.ts +1 -0
- package/dist/extension/browsers/browsers-lib/messages.d.ts +3 -3
- package/dist/extension/browsers/browsers-lib/ready-stamp.d.ts +2 -0
- package/dist/extension/browsers/run-firefox/rdp/rdp-extension-controller/index.d.ts +1 -0
- package/dist/extension/browsers/run-firefox/rdp/remote-firefox/index.d.ts +1 -0
- package/dist/extension/browsers/run-safari/safari-launch/index.d.ts +2 -1
- package/dist/extension/helpers/messaging.d.ts +4 -0
- package/dist/extension/helpers/no-browser.d.ts +1 -0
- package/dist/extension/helpers/telemetry.d.ts +1 -1
- package/package.json +4 -4
package/dist/cli.cjs
CHANGED
|
@@ -96,6 +96,14 @@ var __webpack_modules__ = {
|
|
|
96
96
|
} catch {}
|
|
97
97
|
return deriveChromiumExtensionIdFromPath(outPath);
|
|
98
98
|
}
|
|
99
|
+
function expectedGeckoExtensionId(outPath) {
|
|
100
|
+
try {
|
|
101
|
+
const manifest = JSON.parse(node_fs__rspack_import_1.readFileSync(node_path__rspack_import_2.join(outPath, 'manifest.json'), 'utf-8'));
|
|
102
|
+
return deriveFirefoxExtensionIdFromManifest(manifest);
|
|
103
|
+
} catch {
|
|
104
|
+
return '';
|
|
105
|
+
}
|
|
106
|
+
}
|
|
99
107
|
function resolveExtensionId(args) {
|
|
100
108
|
const fromInfo = toNormalizedId(args.info?.extensionId);
|
|
101
109
|
if (fromInfo) return fromInfo;
|
|
@@ -148,13 +156,13 @@ var __webpack_modules__ = {
|
|
|
148
156
|
}
|
|
149
157
|
};
|
|
150
158
|
const updateSuffix = readUpdateSuffixOnce();
|
|
151
|
-
|
|
152
|
-
|
|
159
|
+
(0, _helpers_messaging__rspack_import_3._w)(_messages__rspack_import_5.io());
|
|
160
|
+
(0, _helpers_messaging__rspack_import_3._w)(_messages__rspack_import_5.e_(manifest, opts.browser, message, opts.browserVersionLine, updateSuffix || void 0, {
|
|
153
161
|
profilePath: opts.profilePath,
|
|
154
162
|
binaryPath: opts.binaryPath,
|
|
155
163
|
binaryProvenance: opts.binaryProvenance
|
|
156
164
|
}));
|
|
157
|
-
|
|
165
|
+
(0, _helpers_messaging__rspack_import_3._w)(_messages__rspack_import_5.io());
|
|
158
166
|
markCardPrinted(k, opts.browser, opts.outPath);
|
|
159
167
|
return true;
|
|
160
168
|
}
|
|
@@ -189,15 +197,15 @@ var __webpack_modules__ = {
|
|
|
189
197
|
}
|
|
190
198
|
};
|
|
191
199
|
const updateSuffix = readUpdateSuffixOnce();
|
|
192
|
-
|
|
193
|
-
|
|
200
|
+
(0, _helpers_messaging__rspack_import_3._w)(_messages__rspack_import_5.io());
|
|
201
|
+
(0, _helpers_messaging__rspack_import_3._w)(_messages__rspack_import_5.e_(manifest, opts.browser, message, browserLabel, updateSuffix || void 0, {
|
|
194
202
|
includeExtensionId: opts.includeExtensionId,
|
|
195
203
|
runLabel,
|
|
196
204
|
profilePath: opts.profilePath,
|
|
197
205
|
binaryPath: opts.binaryPath,
|
|
198
206
|
binaryProvenance: opts.binaryProvenance
|
|
199
207
|
}));
|
|
200
|
-
|
|
208
|
+
(0, _helpers_messaging__rspack_import_3._w)(_messages__rspack_import_5.io());
|
|
201
209
|
} else {
|
|
202
210
|
const message = {
|
|
203
211
|
data: {
|
|
@@ -209,20 +217,20 @@ var __webpack_modules__ = {
|
|
|
209
217
|
}
|
|
210
218
|
};
|
|
211
219
|
const updateSuffix = readUpdateSuffixOnce();
|
|
212
|
-
|
|
213
|
-
|
|
220
|
+
(0, _helpers_messaging__rspack_import_3._w)(_messages__rspack_import_5.io());
|
|
221
|
+
(0, _helpers_messaging__rspack_import_3._w)(_messages__rspack_import_5.e_(manifest, opts.browser, message, browserLabel, updateSuffix || void 0, {
|
|
214
222
|
includeExtensionId: opts.includeExtensionId,
|
|
215
223
|
runLabel,
|
|
216
224
|
profilePath: opts.profilePath,
|
|
217
225
|
binaryPath: opts.binaryPath,
|
|
218
226
|
binaryProvenance: opts.binaryProvenance
|
|
219
227
|
}));
|
|
220
|
-
|
|
228
|
+
(0, _helpers_messaging__rspack_import_3._w)(_messages__rspack_import_5.io());
|
|
221
229
|
}
|
|
222
230
|
} catch {
|
|
223
231
|
const provenanceNote = _messages__rspack_import_5.xX(opts.binaryProvenance);
|
|
224
|
-
|
|
225
|
-
|
|
232
|
+
(0, _helpers_messaging__rspack_import_3._w)(_messages__rspack_import_5.io());
|
|
233
|
+
(0, _helpers_messaging__rspack_import_3._w)((0, _helpers_messaging__rspack_import_3.Nr)({
|
|
226
234
|
rows: [
|
|
227
235
|
{
|
|
228
236
|
label: 'Browser',
|
|
@@ -242,13 +250,14 @@ var __webpack_modules__ = {
|
|
|
242
250
|
}
|
|
243
251
|
]
|
|
244
252
|
}));
|
|
245
|
-
|
|
253
|
+
(0, _helpers_messaging__rspack_import_3._w)(_messages__rspack_import_5.io());
|
|
246
254
|
}
|
|
247
255
|
markCardPrinted(k, opts.browser, opts.outPath);
|
|
248
256
|
return true;
|
|
249
257
|
}
|
|
250
258
|
__webpack_require__.d(__webpack_exports__, {
|
|
251
259
|
MK: ()=>printProdBannerOnce,
|
|
260
|
+
MT: ()=>expectedGeckoExtensionId,
|
|
252
261
|
ai: ()=>printDevBannerOnce,
|
|
253
262
|
vy: ()=>expectedChromiumExtensionId
|
|
254
263
|
});
|
|
@@ -491,11 +500,11 @@ var __webpack_modules__ = {
|
|
|
491
500
|
})();
|
|
492
501
|
return `${getLoggingPrefix('error')} ${isUnreachable}${pintor__rspack_import_8_default().gray('NOT FOUND')} ${pintor__rspack_import_8_default().underline(browserBinaryLocation || `${capitalizedBrowserName(browser)}BROWSER`)}\nInstall the missing browser, or choose another one with ${pintor__rspack_import_8_default().blue('--browser')} ${pintor__rspack_import_8_default().gray('<chrome|edge|firefox>')}.` + wslHint;
|
|
493
502
|
}
|
|
494
|
-
function usingManagedChromiumFamilyFallback(requestedBrowser,
|
|
495
|
-
return `${getLoggingPrefix('
|
|
503
|
+
function usingManagedChromiumFamilyFallback(requestedBrowser, _fallbackBrowser, _binaryPath) {
|
|
504
|
+
return `${getLoggingPrefix('warn')} ${managedBrowserDisplayName(requestedBrowser)} isn't installed.\nRun ${pintor__rspack_import_8_default().blue(`npx extension install ${requestedBrowser}`)} to use ${managedBrowserDisplayName(requestedBrowser)} itself.`;
|
|
496
505
|
}
|
|
497
|
-
function preferringSystemBrowserOverSnapshot(
|
|
498
|
-
return `${getLoggingPrefix('
|
|
506
|
+
function preferringSystemBrowserOverSnapshot(_systemBinary, _snapshotBinary) {
|
|
507
|
+
return `${getLoggingPrefix('warn')} Set ${pintor__rspack_import_8_default().blue('EXTENSION_PREFER_CHROMIUM_SNAPSHOT=true')} to use the cached Chromium snapshot instead.`;
|
|
499
508
|
}
|
|
500
509
|
function mv2NotSupportedByChromium(extensionPath) {
|
|
501
510
|
return `${getLoggingPrefix('warn')} ${pintor__rspack_import_8_default().brightYellow('This extension declares Manifest V2, which modern Chromium refuses to load.')}\n${pintor__rspack_import_8_default().gray('PATH')} ${pintor__rspack_import_8_default().underline(extensionPath)}\nThe browser will reject it at launch (a native dialog, not a console error), so the dev session can't attach.\nRun it on an MV2-capable browser (${pintor__rspack_import_8_default().blue('--browser firefox')}) or migrate the manifest to MV3.`;
|
|
@@ -524,8 +533,8 @@ var __webpack_modules__ = {
|
|
|
524
533
|
function geckoAddonLoadRefused(addonPath, reason) {
|
|
525
534
|
return `${getLoggingPrefix('error')} ${pintor__rspack_import_8_default().red("The browser refused to load this add-on, so it isn't running.")}\n${pintor__rspack_import_8_default().gray('PATH')} ${pintor__rspack_import_8_default().underline(addonPath)}\n` + (reason ? `${pintor__rspack_import_8_default().gray('REASON')} ${pintor__rspack_import_8_default().red(reason)}\n` : '') + `No background script, content script, or page from this add-on will run, and no Extension ID was assigned.\n` + `Fix the reason above and save.\n` + "If the browser doesn't pick it up, restart the dev session.";
|
|
526
535
|
}
|
|
527
|
-
function devChannelSnapshotInUse(
|
|
528
|
-
return `${getLoggingPrefix('warn')}
|
|
536
|
+
function devChannelSnapshotInUse(_binaryPath) {
|
|
537
|
+
return `${getLoggingPrefix('warn')} Chromium snapshot behavior may differ from stable Chrome.\nInstall a stable browser or remove the snapshot to stop using it.`;
|
|
529
538
|
}
|
|
530
539
|
function browserLaunchError(browser, error) {
|
|
531
540
|
return `${getLoggingPrefix('error')} Can't launch ${capitalizedBrowserName(browser)}.\n${pintor__rspack_import_8_default().red(errorDetail(error))}`;
|
|
@@ -697,7 +706,7 @@ var __webpack_modules__ = {
|
|
|
697
706
|
return `${getLoggingPrefix('warn')} safari-web-extension-converter reported ${pintor__rspack_import_8_default().yellow(String(warnings.length))} ${1 === warnings.length ? 'warning' : 'warnings'}, some manifest keys/APIs may not be supported by Safari:\n` + warnings.map((line)=>` ${pintor__rspack_import_8_default().gray('•')} ${line}`).join('\n');
|
|
698
707
|
}
|
|
699
708
|
function safariDefaultBundleIdNote(bundleId) {
|
|
700
|
-
return `${getLoggingPrefix('
|
|
709
|
+
return `${getLoggingPrefix('warn')} The bundle id ${pintor__rspack_import_8_default().gray(bundleId)} is generated from the app name.\nEvery project built from the same source shares this id, and the first team to register it takes it.\nSet your own with ${pintor__rspack_import_8_default().blue('--bundle-id')} before your first submission.\nAfter a submission, a new id is a new extension with none of your users.`;
|
|
701
710
|
}
|
|
702
711
|
function safariOpenHint(appPath, appName) {
|
|
703
712
|
return `${getLoggingPrefix('info')} Launch it once to register with Safari: ${pintor__rspack_import_8_default().blue('open')} ${pintor__rspack_import_8_default().underline(`"${appPath}"`)}\nThen enable ${pintor__rspack_import_8_default().yellow(appName)} via Safari ▸ Develop ▸ ${pintor__rspack_import_8_default().yellow('Allow Unsigned Extensions')} and Safari ▸ Settings ▸ Extensions.`;
|
|
@@ -718,7 +727,7 @@ var __webpack_modules__ = {
|
|
|
718
727
|
return `${getLoggingPrefix('success')} Safari recognizes ${pintor__rspack_import_8_default().yellow(appName)}, finish enabling it with the steps above.`;
|
|
719
728
|
}
|
|
720
729
|
function safariNotYetRegistered(appName) {
|
|
721
|
-
return `${getLoggingPrefix('
|
|
730
|
+
return `${getLoggingPrefix('info')} Safari hasn't picked up ${pintor__rspack_import_8_default().yellow(appName)} yet.\nOpen the app once, then check Safari ▸ Settings ▸ Extensions.`;
|
|
722
731
|
}
|
|
723
732
|
function safariRebuilt(appName) {
|
|
724
733
|
return `${getLoggingPrefix('success')} Rebuilt ${pintor__rspack_import_8_default().yellow(appName)}, reload the page (or toggle the extension) in Safari to see changes.`;
|
|
@@ -1203,7 +1212,7 @@ var __webpack_modules__ = {
|
|
|
1203
1212
|
return !!child && terminatedByUs.has(child);
|
|
1204
1213
|
}
|
|
1205
1214
|
function authorLog(line) {
|
|
1206
|
-
if (line && (0, _helpers_messaging__rspack_import_1._o)())
|
|
1215
|
+
if (line && (0, _helpers_messaging__rspack_import_1._o)()) (0, _helpers_messaging__rspack_import_1._w)(line);
|
|
1207
1216
|
}
|
|
1208
1217
|
function killWindowsTree(child, sync) {
|
|
1209
1218
|
if ('win32' !== process.platform) return;
|
|
@@ -1305,6 +1314,20 @@ var __webpack_modules__ = {
|
|
|
1305
1314
|
const profilePath = String(details?.profilePath || '').trim();
|
|
1306
1315
|
if (profilePath) ready.profilePath = profilePath;
|
|
1307
1316
|
if ('number' == typeof details?.browserPid && Number.isFinite(details.browserPid)) ready.browserPid = details.browserPid;
|
|
1317
|
+
const extensionId = String(details?.extensionId || '').trim();
|
|
1318
|
+
if (extensionId) ready.extensionId = extensionId;
|
|
1319
|
+
node_fs__rspack_import_0.writeFileSync(readyPath, JSON.stringify(ready, null, 2));
|
|
1320
|
+
} catch {}
|
|
1321
|
+
}
|
|
1322
|
+
function stampReadyExtensionId(extensionOutputPath, extensionId) {
|
|
1323
|
+
try {
|
|
1324
|
+
const id = String(extensionId || '').trim();
|
|
1325
|
+
if (!extensionOutputPath || !id) return;
|
|
1326
|
+
const readyPath = readyPathFor(extensionOutputPath);
|
|
1327
|
+
if (!node_fs__rspack_import_0.existsSync(readyPath)) return;
|
|
1328
|
+
const ready = JSON.parse(node_fs__rspack_import_0.readFileSync(readyPath, 'utf-8'));
|
|
1329
|
+
if (ready.extensionId === id) return;
|
|
1330
|
+
ready.extensionId = id;
|
|
1308
1331
|
node_fs__rspack_import_0.writeFileSync(readyPath, JSON.stringify(ready, null, 2));
|
|
1309
1332
|
} catch {}
|
|
1310
1333
|
}
|
|
@@ -1357,6 +1380,7 @@ var __webpack_modules__ = {
|
|
|
1357
1380
|
M: ()=>stampReadyBrowserLaunch,
|
|
1358
1381
|
Wi: ()=>stampReadyBrowserExited,
|
|
1359
1382
|
__: ()=>stampReadyRdpPort,
|
|
1383
|
+
hg: ()=>stampReadyExtensionId,
|
|
1360
1384
|
iD: ()=>stampReadyProfileLocked,
|
|
1361
1385
|
sf: ()=>stampReadyExtensionLoadRefused
|
|
1362
1386
|
});
|
|
@@ -1941,6 +1965,7 @@ var __webpack_modules__ = {
|
|
|
1941
1965
|
});
|
|
1942
1966
|
const external_node_http_namespaceObject = require("node:http");
|
|
1943
1967
|
var external_node_net_ = __webpack_require__("node:net");
|
|
1968
|
+
var messaging = __webpack_require__("./helpers/messaging.ts");
|
|
1944
1969
|
var constants = __webpack_require__("./browsers/browsers-lib/constants.ts");
|
|
1945
1970
|
var messages = __webpack_require__("./browsers/browsers-lib/messages.ts");
|
|
1946
1971
|
async function getJson(host, port, path) {
|
|
@@ -1973,14 +1998,14 @@ var __webpack_modules__ = {
|
|
|
1973
1998
|
const version = await getJson(host, port, '/json/version');
|
|
1974
1999
|
const wsUrl = 'string' == typeof version?.webSocketDebuggerUrl ? version.webSocketDebuggerUrl : void 0;
|
|
1975
2000
|
if (wsUrl) {
|
|
1976
|
-
if (isDev)
|
|
2001
|
+
if (isDev) (0, messaging._w)(messages.Te());
|
|
1977
2002
|
return wsUrl;
|
|
1978
2003
|
}
|
|
1979
2004
|
} catch (error) {
|
|
1980
|
-
if (isDev)
|
|
2005
|
+
if (isDev) (0, messaging.mR)('[CDP] Failed to read /json/version:', String(error?.message || error));
|
|
1981
2006
|
}
|
|
1982
2007
|
const targets = await getJson(host, port, '/json');
|
|
1983
|
-
if (isDev)
|
|
2008
|
+
if (isDev) (0, messaging._w)(messages.FF((targets || []).length || 0));
|
|
1984
2009
|
const pageTarget = (targets || []).find((target)=>{
|
|
1985
2010
|
const type = String(target?.type || '');
|
|
1986
2011
|
const ws = 'string' == typeof target?.webSocketDebuggerUrl ? target.webSocketDebuggerUrl : '';
|
|
@@ -1988,7 +2013,7 @@ var __webpack_modules__ = {
|
|
|
1988
2013
|
});
|
|
1989
2014
|
const pageWs = 'string' == typeof pageTarget?.webSocketDebuggerUrl ? pageTarget.webSocketDebuggerUrl : '';
|
|
1990
2015
|
if (pageWs) {
|
|
1991
|
-
if (isDev)
|
|
2016
|
+
if (isDev) (0, messaging._w)(messages.Te());
|
|
1992
2017
|
return pageWs;
|
|
1993
2018
|
}
|
|
1994
2019
|
throw new Error('No CDP WebSocket URL available');
|
|
@@ -2444,7 +2469,7 @@ var __webpack_modules__ = {
|
|
|
2444
2469
|
});
|
|
2445
2470
|
const userProfilePath = resolved.profilePath;
|
|
2446
2471
|
if ('managed' === resolved.kind) {
|
|
2447
|
-
if ((0, messaging._o)())
|
|
2472
|
+
if ((0, messaging._o)()) (0, messaging._w)(messages.sY(shownPath(userProfilePath)));
|
|
2448
2473
|
if (!resolved.persisted) try {
|
|
2449
2474
|
const maxAgeHours = parseInt(String(process.env.EXTENSION_TMP_PROFILE_MAX_AGE_HOURS || ''), 10);
|
|
2450
2475
|
(0, shared_utils.CW)(managedBaseDir, external_node_path_.basename(userProfilePath), Number.isFinite(maxAgeHours) ? maxAgeHours : 12);
|
|
@@ -2500,10 +2525,10 @@ var __webpack_modules__ = {
|
|
|
2500
2525
|
return (0, shared_utils.Py)(baseFlags);
|
|
2501
2526
|
}
|
|
2502
2527
|
function logChromiumDryRun(browserBinaryLocation, chromiumConfig) {
|
|
2503
|
-
if ((0, messaging._o)())
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2528
|
+
if ((0, messaging._o)()) (0, messaging._w)(messages.xy());
|
|
2529
|
+
(0, messaging._w)(messages.Nk());
|
|
2530
|
+
(0, messaging._w)(messages.Q0(browserBinaryLocation));
|
|
2531
|
+
(0, messaging._w)(messages.E8(chromiumConfig.join(' ')));
|
|
2507
2532
|
}
|
|
2508
2533
|
var extension_output_path = __webpack_require__("./browsers/run-chromium/chromium-launch/extension-output-path.ts");
|
|
2509
2534
|
const activeInstances = new Set();
|
|
@@ -2513,11 +2538,11 @@ var __webpack_modules__ = {
|
|
|
2513
2538
|
instance.isCleaningUp = true;
|
|
2514
2539
|
const { browser, child, cleanupInstance } = instance;
|
|
2515
2540
|
try {
|
|
2516
|
-
if ((0, messaging._o)())
|
|
2541
|
+
if ((0, messaging._o)()) (0, messaging._w)(messages.Vk(browser));
|
|
2517
2542
|
(0, process_teardown.Df)(child, browser);
|
|
2518
2543
|
cleanupInstance();
|
|
2519
2544
|
} catch (error) {
|
|
2520
|
-
|
|
2545
|
+
(0, messaging.Gg)(messages.TF(browser, error));
|
|
2521
2546
|
}
|
|
2522
2547
|
}
|
|
2523
2548
|
function cleanupAll() {
|
|
@@ -2539,13 +2564,13 @@ var __webpack_modules__ = {
|
|
|
2539
2564
|
process.on('exit', forceKillAllOnExit);
|
|
2540
2565
|
process.on('uncaughtException', (error)=>{
|
|
2541
2566
|
if ((0, process_teardown.FA)(error)) return;
|
|
2542
|
-
|
|
2567
|
+
(0, messaging.Gg)(messages.F4(firstBrowserLabel(), error));
|
|
2543
2568
|
cleanupAll();
|
|
2544
2569
|
process.exit(1);
|
|
2545
2570
|
});
|
|
2546
2571
|
process.on('unhandledRejection', (reason)=>{
|
|
2547
2572
|
if ((0, process_teardown.FA)(reason)) return;
|
|
2548
|
-
|
|
2573
|
+
(0, messaging.Gg)(messages.N4(firstBrowserLabel(), reason));
|
|
2549
2574
|
cleanupAll();
|
|
2550
2575
|
process.exit(1);
|
|
2551
2576
|
});
|
|
@@ -2731,9 +2756,9 @@ var __webpack_modules__ = {
|
|
|
2731
2756
|
}
|
|
2732
2757
|
async runOnce(compilation, opts) {
|
|
2733
2758
|
if (!this.logger) this.logger = {
|
|
2734
|
-
info: (...a)=>
|
|
2735
|
-
warn: (...a)=>
|
|
2736
|
-
error: (...a)=>
|
|
2759
|
+
info: (...a)=>(0, messaging._w)(...a),
|
|
2760
|
+
warn: (...a)=>(0, messaging.mR)(...a),
|
|
2761
|
+
error: (...a)=>(0, messaging.Gg)(...a),
|
|
2737
2762
|
debug: (...a)=>console.debug?.(...a)
|
|
2738
2763
|
};
|
|
2739
2764
|
await this.launchChromium(compilation, opts);
|
|
@@ -2741,9 +2766,9 @@ var __webpack_modules__ = {
|
|
|
2741
2766
|
apply(compiler) {
|
|
2742
2767
|
const host = compiler;
|
|
2743
2768
|
this.logger = 'function' == typeof host?.getInfrastructureLogger ? host.getInfrastructureLogger('ChromiumLaunchPlugin') : {
|
|
2744
|
-
info: (...a)=>
|
|
2745
|
-
warn: (...a)=>
|
|
2746
|
-
error: (...a)=>
|
|
2769
|
+
info: (...a)=>(0, messaging._w)(...a),
|
|
2770
|
+
warn: (...a)=>(0, messaging.mR)(...a),
|
|
2771
|
+
error: (...a)=>(0, messaging.Gg)(...a),
|
|
2747
2772
|
debug: (...a)=>console.debug?.(...a)
|
|
2748
2773
|
};
|
|
2749
2774
|
host.hooks.done.tapPromise('chromium:launch', async (stats)=>{
|
|
@@ -2753,7 +2778,7 @@ var __webpack_modules__ = {
|
|
|
2753
2778
|
if (this.didLaunch) return;
|
|
2754
2779
|
await this.launchChromium(stats.compilation);
|
|
2755
2780
|
this.didLaunch = true;
|
|
2756
|
-
if (!this.didReportReady && !this.extensionLoadRefused)
|
|
2781
|
+
if (!this.didReportReady && !this.extensionLoadRefused) (0, messaging._w)((0, ready_message.G)(stats.compilation.options.mode, this.options.browser));
|
|
2757
2782
|
} catch (error) {
|
|
2758
2783
|
try {
|
|
2759
2784
|
this.logger.error(messages._D(this.options.browser, error));
|
|
@@ -2841,11 +2866,11 @@ var __webpack_modules__ = {
|
|
|
2841
2866
|
preferManagedSnapshot: 'true' === String(process.env.EXTENSION_PREFER_CHROMIUM_SNAPSHOT || '').toLowerCase().trim()
|
|
2842
2867
|
});
|
|
2843
2868
|
if (choice.swappedToSystem && choice.binary) {
|
|
2844
|
-
|
|
2869
|
+
(0, messaging.mR)(messages.kK(choice.binary, browserBinaryLocation));
|
|
2845
2870
|
browserBinaryLocation = choice.binary;
|
|
2846
2871
|
} else if (choice.usedManagedSnapshot) {
|
|
2847
2872
|
usedManagedSnapshot = true;
|
|
2848
|
-
|
|
2873
|
+
(0, messaging.mR)(messages.JB(browserBinaryLocation));
|
|
2849
2874
|
}
|
|
2850
2875
|
}
|
|
2851
2876
|
let skipDetection = Boolean(browserBinaryLocation);
|
|
@@ -2928,14 +2953,14 @@ var __webpack_modules__ = {
|
|
|
2928
2953
|
};
|
|
2929
2954
|
switch(browser){
|
|
2930
2955
|
case 'chrome':
|
|
2931
|
-
if (isAuthorMode)
|
|
2956
|
+
if (isAuthorMode) (0, messaging._w)(messages.Gq(browser));
|
|
2932
2957
|
if (!skipDetection) browserBinaryLocation = resolveChromeLikeBinary();
|
|
2933
2958
|
break;
|
|
2934
2959
|
case 'brave':
|
|
2935
2960
|
case 'opera':
|
|
2936
2961
|
case 'vivaldi':
|
|
2937
2962
|
case 'yandex':
|
|
2938
|
-
if (isAuthorMode)
|
|
2963
|
+
if (isAuthorMode) (0, messaging._w)(messages.Gq(browser));
|
|
2939
2964
|
if (!skipDetection) try {
|
|
2940
2965
|
const locate = 'brave' === browser ? external_brave_location_default() : 'opera' === browser ? external_opera_location2_default() : 'vivaldi' === browser ? external_vivaldi_location2_default() : external_yandex_location_default();
|
|
2941
2966
|
const located = locate(true, {
|
|
@@ -2947,11 +2972,11 @@ var __webpack_modules__ = {
|
|
|
2947
2972
|
if (!browserBinaryLocation) browserBinaryLocation = resolveWslFallback();
|
|
2948
2973
|
break;
|
|
2949
2974
|
case 'chromium':
|
|
2950
|
-
if (isAuthorMode)
|
|
2975
|
+
if (isAuthorMode) (0, messaging._w)(messages.Gq(browser));
|
|
2951
2976
|
if (this.options?.chromiumBinary) {
|
|
2952
2977
|
const normalized = normalizePath(String(this.options.chromiumBinary));
|
|
2953
2978
|
if (!normalized || !external_node_fs_.existsSync(normalized)) {
|
|
2954
|
-
|
|
2979
|
+
(0, messaging.Gg)(messages.Sp(String(this.options.chromiumBinary)));
|
|
2955
2980
|
process.exit(1);
|
|
2956
2981
|
}
|
|
2957
2982
|
browserBinaryLocation = normalized;
|
|
@@ -2970,7 +2995,7 @@ var __webpack_modules__ = {
|
|
|
2970
2995
|
if (!browserBinaryLocation) browserBinaryLocation = resolveWslFallback();
|
|
2971
2996
|
break;
|
|
2972
2997
|
case 'edge':
|
|
2973
|
-
if (isAuthorMode)
|
|
2998
|
+
if (isAuthorMode) (0, messaging._w)(messages.Gq(browser));
|
|
2974
2999
|
try {
|
|
2975
3000
|
const override = String(process.env.EDGE_BINARY || '').trim();
|
|
2976
3001
|
if (override) {
|
|
@@ -3014,13 +3039,13 @@ var __webpack_modules__ = {
|
|
|
3014
3039
|
if (this.options?.chromiumBinary) {
|
|
3015
3040
|
const normalized = normalizePath(String(this.options.chromiumBinary));
|
|
3016
3041
|
if (!normalized || !external_node_fs_.existsSync(normalized)) {
|
|
3017
|
-
|
|
3042
|
+
(0, messaging.Gg)(messages.Sp(String(this.options.chromiumBinary)));
|
|
3018
3043
|
process.exit(1);
|
|
3019
3044
|
}
|
|
3020
3045
|
browserBinaryLocation = normalized;
|
|
3021
3046
|
binaryPinnedByFlag = true;
|
|
3022
3047
|
} else {
|
|
3023
|
-
|
|
3048
|
+
(0, messaging.Gg)(messages.ne());
|
|
3024
3049
|
process.exit(1);
|
|
3025
3050
|
}
|
|
3026
3051
|
if (!browserBinaryLocation && !skipDetection) try {
|
|
@@ -3046,7 +3071,7 @@ var __webpack_modules__ = {
|
|
|
3046
3071
|
const familyFallback = output_binaries_resolver.zN(compilation, browser);
|
|
3047
3072
|
const normalized = normalizePath(familyFallback?.binary || null);
|
|
3048
3073
|
if (familyFallback && isUsableBinary(normalized)) {
|
|
3049
|
-
|
|
3074
|
+
(0, messaging.mR)(messages.Ug(browser, familyFallback.browser, normalized));
|
|
3050
3075
|
browserBinaryLocation = normalized;
|
|
3051
3076
|
}
|
|
3052
3077
|
}
|
|
@@ -3073,18 +3098,18 @@ var __webpack_modules__ = {
|
|
|
3073
3098
|
for (const extPath of extensionsToLoad)try {
|
|
3074
3099
|
const m = JSON.parse(external_node_fs_.readFileSync(external_node_path_.join(String(extPath), 'manifest.json'), 'utf8'));
|
|
3075
3100
|
const refusal = diagnoseChromiumManifestRefusal(m);
|
|
3076
|
-
if ('mv2' === refusal)
|
|
3077
|
-
else if ("mv3-background-scripts" === refusal)
|
|
3078
|
-
else if ('unsupported-manifest-version' === refusal)
|
|
3101
|
+
if ('mv2' === refusal) (0, messaging.mR)(messages.sP(String(extPath)));
|
|
3102
|
+
else if ("mv3-background-scripts" === refusal) (0, messaging.mR)(messages.NO(String(extPath)));
|
|
3103
|
+
else if ('unsupported-manifest-version' === refusal) (0, messaging.mR)(messages.CN(String(extPath), m?.manifest_version));
|
|
3079
3104
|
const invalidPatterns = findInvalidMatchPatterns(m);
|
|
3080
|
-
if (invalidPatterns.length)
|
|
3105
|
+
if (invalidPatterns.length) (0, messaging.mR)(messages.qR(String(extPath), invalidPatterns));
|
|
3081
3106
|
const loadBlockers = [
|
|
3082
3107
|
...findChromiumLoadBlockers(m, resolvedBrowserVersion),
|
|
3083
3108
|
...findUnloadableIconFiles(m, String(extPath)),
|
|
3084
3109
|
...findLocaleLoadBlockers(m, String(extPath)),
|
|
3085
3110
|
...findMissingManagedSchema(m, String(extPath))
|
|
3086
3111
|
];
|
|
3087
|
-
if (loadBlockers.length)
|
|
3112
|
+
if (loadBlockers.length) (0, messaging.mR)(messages.L(String(extPath), loadBlockers));
|
|
3088
3113
|
} catch {}
|
|
3089
3114
|
let chromiumConfig;
|
|
3090
3115
|
try {
|
|
@@ -3133,9 +3158,11 @@ var __webpack_modules__ = {
|
|
|
3133
3158
|
extensionOutputPath: (0, extension_output_path.W)(compilation, chromiumConfig.find((flag)=>flag.startsWith('--load-extension='))) || void 0
|
|
3134
3159
|
};
|
|
3135
3160
|
const child = await this.launchWithDirectSpawn(browserBinaryLocation, chromiumConfig, usePipe);
|
|
3136
|
-
|
|
3161
|
+
const launchOutputPath = this.closeHandlerContext?.extensionOutputPath;
|
|
3162
|
+
(0, ready_stamp.M)(launchOutputPath, {
|
|
3137
3163
|
profilePath: chromiumConfig.find((flag)=>flag.startsWith('--user-data-dir='))?.slice('--user-data-dir='.length).replace(/^"|"$/g, ''),
|
|
3138
|
-
browserPid: child?.pid
|
|
3164
|
+
browserPid: child?.pid,
|
|
3165
|
+
extensionId: launchOutputPath ? (0, banner.vy)(launchOutputPath) : void 0
|
|
3139
3166
|
});
|
|
3140
3167
|
const pipeStreams = usePipe && child?.stdio?.[3] && child?.stdio?.[4] ? {
|
|
3141
3168
|
input: child.stdio[4],
|
|
@@ -3153,7 +3180,7 @@ var __webpack_modules__ = {
|
|
|
3153
3180
|
const reportReady = ()=>{
|
|
3154
3181
|
if ('development' !== compilation.options.mode) return;
|
|
3155
3182
|
if (this.didReportReady || this.extensionLoadRefused) return;
|
|
3156
|
-
|
|
3183
|
+
(0, messaging._w)((0, ready_message.G)(compilation.options.mode, this.options.browser));
|
|
3157
3184
|
this.didReportReady = true;
|
|
3158
3185
|
};
|
|
3159
3186
|
if (!enableCdp) reportReady();
|
|
@@ -3188,7 +3215,7 @@ var __webpack_modules__ = {
|
|
|
3188
3215
|
} catch (error) {
|
|
3189
3216
|
const message = String(error && error.message);
|
|
3190
3217
|
const hint = /timed out|did not complete/i.test(message) ? " Chrome likely rejected the extension at launch, open chrome://extensions in the dev browser window for the exact error. Common causes: MV3 content_security_policy with 'unsafe-inline', manifest keys Chrome does not support, or manifest references to missing files. Reload/HMR cannot attach until this is fixed." : '';
|
|
3191
|
-
|
|
3218
|
+
(0, messaging.Gg)(`[browser] ${message}${hint}`);
|
|
3192
3219
|
reportReady();
|
|
3193
3220
|
}
|
|
3194
3221
|
}
|
|
@@ -3260,13 +3287,13 @@ var __webpack_modules__ = {
|
|
|
3260
3287
|
try {
|
|
3261
3288
|
const displayCacheDir = output_binaries_resolver.LB(compilation);
|
|
3262
3289
|
const pretty = messages.MG(browserName || this.options.browser, raw, displayCacheDir);
|
|
3263
|
-
|
|
3290
|
+
(0, messaging.Gg)(pretty);
|
|
3264
3291
|
} catch {
|
|
3265
3292
|
try {
|
|
3266
3293
|
const pretty = messages.MG(browserName || this.options.browser, raw, '');
|
|
3267
|
-
|
|
3294
|
+
(0, messaging.Gg)(pretty);
|
|
3268
3295
|
} catch {
|
|
3269
|
-
|
|
3296
|
+
(0, messaging.Gg)(raw);
|
|
3270
3297
|
}
|
|
3271
3298
|
}
|
|
3272
3299
|
}
|
|
@@ -3452,6 +3479,7 @@ var __webpack_modules__ = {
|
|
|
3452
3479
|
const external_waterfox_location_namespaceObject = require("waterfox-location");
|
|
3453
3480
|
var external_waterfox_location_default = /*#__PURE__*/ __webpack_require__.n(external_waterfox_location_namespaceObject);
|
|
3454
3481
|
var messaging = __webpack_require__("./helpers/messaging.ts");
|
|
3482
|
+
var banner = __webpack_require__("./browsers/browsers-lib/banner.ts");
|
|
3455
3483
|
var instance_registry = __webpack_require__("./browsers/browsers-lib/instance-registry.ts");
|
|
3456
3484
|
var messages = __webpack_require__("./browsers/browsers-lib/messages.ts");
|
|
3457
3485
|
var output_binaries_resolver = __webpack_require__("./browsers/browsers-lib/output-binaries-resolver.ts");
|
|
@@ -3632,7 +3660,7 @@ var __webpack_modules__ = {
|
|
|
3632
3660
|
});
|
|
3633
3661
|
const profilePath = resolved.profilePath;
|
|
3634
3662
|
if ('managed' === resolved.kind) {
|
|
3635
|
-
if ((0, messaging._o)())
|
|
3663
|
+
if ((0, messaging._o)()) (0, messaging._w)(messages.sY(shownPath(profilePath)));
|
|
3636
3664
|
if (!resolved.persisted) try {
|
|
3637
3665
|
const maxAgeHours = parseInt(String(process.env.EXTENSION_TMP_PROFILE_MAX_AGE_HOURS || ''), 10);
|
|
3638
3666
|
(0, shared_utils.CW)(managedBaseDir, external_node_path_.basename(profilePath), Number.isFinite(maxAgeHours) ? maxAgeHours : 12);
|
|
@@ -3674,10 +3702,10 @@ var __webpack_modules__ = {
|
|
|
3674
3702
|
return parts.join(' ');
|
|
3675
3703
|
}
|
|
3676
3704
|
function logFirefoxDryRun(browserBinaryLocation, firefoxConfig) {
|
|
3677
|
-
if ((0, messaging._o)())
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3705
|
+
if ((0, messaging._o)()) (0, messaging._w)(messages.A9());
|
|
3706
|
+
(0, messaging._w)(messages.qn());
|
|
3707
|
+
(0, messaging._w)(messages.LD(browserBinaryLocation));
|
|
3708
|
+
(0, messaging._w)(messages.k6(firefoxConfig));
|
|
3681
3709
|
}
|
|
3682
3710
|
const activeInstances = new Set();
|
|
3683
3711
|
let globalHandlersInstalled = false;
|
|
@@ -3686,11 +3714,11 @@ var __webpack_modules__ = {
|
|
|
3686
3714
|
instance.isCleaningUp = true;
|
|
3687
3715
|
const { browser, childRef, cleanupInstance } = instance;
|
|
3688
3716
|
try {
|
|
3689
|
-
if ((0, messaging._o)())
|
|
3717
|
+
if ((0, messaging._o)()) (0, messaging._w)(messages.Vk(browser));
|
|
3690
3718
|
(0, process_teardown.Df)(childRef(), browser);
|
|
3691
3719
|
await cleanupInstance();
|
|
3692
3720
|
} catch (error) {
|
|
3693
|
-
|
|
3721
|
+
(0, messaging.Gg)(messages.TF(browser, error));
|
|
3694
3722
|
}
|
|
3695
3723
|
}
|
|
3696
3724
|
function cleanupAllInstances() {
|
|
@@ -3714,7 +3742,7 @@ var __webpack_modules__ = {
|
|
|
3714
3742
|
process.on('beforeExit', cleanupAllInstances);
|
|
3715
3743
|
process.on('uncaughtException', async (error)=>{
|
|
3716
3744
|
if ((0, process_teardown.FA)(error)) return;
|
|
3717
|
-
|
|
3745
|
+
(0, messaging.Gg)(messages.F4(firstBrowserLabel(), error));
|
|
3718
3746
|
await Promise.all([
|
|
3719
3747
|
...activeInstances
|
|
3720
3748
|
].map((i)=>attemptCleanup(i)));
|
|
@@ -3722,7 +3750,7 @@ var __webpack_modules__ = {
|
|
|
3722
3750
|
});
|
|
3723
3751
|
process.on('unhandledRejection', async (reason)=>{
|
|
3724
3752
|
if ((0, process_teardown.FA)(reason)) return;
|
|
3725
|
-
|
|
3753
|
+
(0, messaging.Gg)(messages.N4(firstBrowserLabel(), reason));
|
|
3726
3754
|
await Promise.all([
|
|
3727
3755
|
...activeInstances
|
|
3728
3756
|
].map((i)=>attemptCleanup(i)));
|
|
@@ -3830,7 +3858,6 @@ var __webpack_modules__ = {
|
|
|
3830
3858
|
}
|
|
3831
3859
|
return clientResponse;
|
|
3832
3860
|
}
|
|
3833
|
-
var banner = __webpack_require__("./browsers/browsers-lib/banner.ts");
|
|
3834
3861
|
async function waitForManifest(outPath, timeoutMs = 8000) {
|
|
3835
3862
|
const manifestPath = external_node_path_.join(outPath, 'manifest.json');
|
|
3836
3863
|
const start = Date.now();
|
|
@@ -4189,7 +4216,7 @@ var __webpack_modules__ = {
|
|
|
4189
4216
|
host,
|
|
4190
4217
|
port
|
|
4191
4218
|
}, ()=>{
|
|
4192
|
-
if ((0, messaging._o)())
|
|
4219
|
+
if ((0, messaging._o)()) (0, messaging._w)(messages.EI(host, port));
|
|
4193
4220
|
resolve();
|
|
4194
4221
|
});
|
|
4195
4222
|
this.conn = c;
|
|
@@ -4433,6 +4460,9 @@ var __webpack_modules__ = {
|
|
|
4433
4460
|
getAddonInstallRefusalReason() {
|
|
4434
4461
|
return this.addonInstallRefusalReason || null;
|
|
4435
4462
|
}
|
|
4463
|
+
getDerivedExtensionId() {
|
|
4464
|
+
return this.derivedExtensionId;
|
|
4465
|
+
}
|
|
4436
4466
|
selectPrimaryAddonPath(compilation, candidateAddonPaths) {
|
|
4437
4467
|
const normalizedOutputPath = String(compilation?.options?.output?.path || '').replace(/\\/g, '/');
|
|
4438
4468
|
if (normalizedOutputPath) {
|
|
@@ -4468,15 +4498,15 @@ var __webpack_modules__ = {
|
|
|
4468
4498
|
} catch (error) {
|
|
4469
4499
|
if (isErrorWithCode('ECONNREFUSED', error)) {
|
|
4470
4500
|
lastError = error;
|
|
4471
|
-
if ((0, messaging._o)() && attempt % RETRY_LOG_EVERY_N_ATTEMPTS === 0)
|
|
4501
|
+
if ((0, messaging._o)() && attempt % RETRY_LOG_EVERY_N_ATTEMPTS === 0) (0, messaging._w)(messages.GB(this.options.browser, port, attempt, MAX_RETRIES));
|
|
4472
4502
|
await new Promise((resolve)=>setTimeout(resolve, RETRY_INTERVAL));
|
|
4473
4503
|
} else {
|
|
4474
4504
|
const err = error;
|
|
4475
|
-
|
|
4505
|
+
(0, messaging.Gg)(messages.dk(this.options.browser, err.stack || String(error)));
|
|
4476
4506
|
throw err;
|
|
4477
4507
|
}
|
|
4478
4508
|
}
|
|
4479
|
-
|
|
4509
|
+
(0, messaging.Gg)(messages.MS(this.options.browser, port));
|
|
4480
4510
|
throw lastError;
|
|
4481
4511
|
}
|
|
4482
4512
|
invalidateConnectionScopedCaches() {
|
|
@@ -4506,10 +4536,10 @@ var __webpack_modules__ = {
|
|
|
4506
4536
|
pollIntervalMs: 150,
|
|
4507
4537
|
stableReadsRequired: 2
|
|
4508
4538
|
});
|
|
4509
|
-
if (!ready && (0, messaging._o)())
|
|
4539
|
+
if (!ready && (0, messaging._o)()) (0, messaging.mR)(`[browser] Firefox add-on output did not fully settle before install: ${addonPath}`);
|
|
4510
4540
|
} catch {}
|
|
4511
4541
|
if ((0, messaging._o)()) try {
|
|
4512
|
-
|
|
4542
|
+
(0, messaging._w)('[browser] Firefox add-on paths:', candidateAddonPaths);
|
|
4513
4543
|
} catch {}
|
|
4514
4544
|
let primaryUserAddonId;
|
|
4515
4545
|
for (const [index, addonPath] of candidateAddonPaths.entries()){
|
|
@@ -4532,7 +4562,7 @@ var __webpack_modules__ = {
|
|
|
4532
4562
|
try {
|
|
4533
4563
|
if (!this.derivedExtensionId) {
|
|
4534
4564
|
this.derivedExtensionId = await deriveMozExtensionId(client);
|
|
4535
|
-
if ((0, messaging._o)() && !this.derivedExtensionId)
|
|
4565
|
+
if ((0, messaging._o)() && !this.derivedExtensionId) (0, messaging.mR)('[browser] Firefox: could not resolve a unique add-on id for the banner (install response had none; multiple or zero moz-extension targets).');
|
|
4536
4566
|
}
|
|
4537
4567
|
} catch {}
|
|
4538
4568
|
this.lastInstalledAddonPath = primaryAddonPath;
|
|
@@ -4592,6 +4622,9 @@ var __webpack_modules__ = {
|
|
|
4592
4622
|
getAddonInstallRefusalReason() {
|
|
4593
4623
|
return this.remote.getAddonInstallRefusalReason();
|
|
4594
4624
|
}
|
|
4625
|
+
getExtensionId() {
|
|
4626
|
+
return this.remote.getDerivedExtensionId();
|
|
4627
|
+
}
|
|
4595
4628
|
async enableUnifiedLogging(opts) {
|
|
4596
4629
|
await this.remote.enableUnifiedLogging(opts);
|
|
4597
4630
|
}
|
|
@@ -4627,7 +4660,7 @@ var __webpack_modules__ = {
|
|
|
4627
4660
|
if (controller.getAddonInstallRefusalReason()) break;
|
|
4628
4661
|
if ((0, messaging._o)()) try {
|
|
4629
4662
|
const msg = error?.message || String(error);
|
|
4630
|
-
|
|
4663
|
+
(0, messaging.mR)(`[browser] Firefox RDP setup retry ${i + 1}/${attempts}: ${msg}`);
|
|
4631
4664
|
} catch {}
|
|
4632
4665
|
const ms = baseMs * 2 ** i;
|
|
4633
4666
|
await new Promise((r)=>setTimeout(r, ms));
|
|
@@ -4724,9 +4757,9 @@ var __webpack_modules__ = {
|
|
|
4724
4757
|
class FirefoxLaunchPlugin {
|
|
4725
4758
|
async runOnce(compilation, options) {
|
|
4726
4759
|
if (!this.ctx.logger) this.ctx.logger = {
|
|
4727
|
-
info: (...a)=>
|
|
4728
|
-
warn: (...a)=>
|
|
4729
|
-
error: (...a)=>
|
|
4760
|
+
info: (...a)=>(0, messaging._w)(...a),
|
|
4761
|
+
warn: (...a)=>(0, messaging.mR)(...a),
|
|
4762
|
+
error: (...a)=>(0, messaging.Gg)(...a),
|
|
4730
4763
|
debug: (...a)=>console?.debug?.(...a)
|
|
4731
4764
|
};
|
|
4732
4765
|
await this.launch(compilation, options);
|
|
@@ -4736,9 +4769,9 @@ var __webpack_modules__ = {
|
|
|
4736
4769
|
apply(compiler) {
|
|
4737
4770
|
const host = compiler;
|
|
4738
4771
|
this.ctx.logger = 'function' == typeof host?.getInfrastructureLogger ? host.getInfrastructureLogger('FirefoxLaunchPlugin') : {
|
|
4739
|
-
info: (...a)=>
|
|
4740
|
-
warn: (...a)=>
|
|
4741
|
-
error: (...a)=>
|
|
4772
|
+
info: (...a)=>(0, messaging._w)(...a),
|
|
4773
|
+
warn: (...a)=>(0, messaging.mR)(...a),
|
|
4774
|
+
error: (...a)=>(0, messaging.Gg)(...a),
|
|
4742
4775
|
debug: (...a)=>console?.debug?.(...a)
|
|
4743
4776
|
};
|
|
4744
4777
|
host.hooks.done.tapAsync('run-firefox:launch', async (stats, done)=>{
|
|
@@ -4751,7 +4784,7 @@ var __webpack_modules__ = {
|
|
|
4751
4784
|
}
|
|
4752
4785
|
if (this.ctx.didLaunch) return void done();
|
|
4753
4786
|
await this.launch(stats.compilation, (0, runtime_options.zU)(this.host, stats.compilation.options.mode));
|
|
4754
|
-
if ('development' === stats.compilation.options.mode && !this.host.extensionLoadRefused)
|
|
4787
|
+
if ('development' === stats.compilation.options.mode && !this.host.extensionLoadRefused) (0, messaging._w)((0, ready_message.G)(stats.compilation.options.mode, this.host.browser));
|
|
4755
4788
|
this.ctx.didLaunch = true;
|
|
4756
4789
|
} catch (error) {
|
|
4757
4790
|
this.ctx.logger?.error?.(messages.MQ(error));
|
|
@@ -4786,7 +4819,7 @@ var __webpack_modules__ = {
|
|
|
4786
4819
|
}
|
|
4787
4820
|
};
|
|
4788
4821
|
const exitForLaunchFailure = (message)=>{
|
|
4789
|
-
if (message)
|
|
4822
|
+
if (message) (0, messaging.Gg)(message);
|
|
4790
4823
|
process.exit(1);
|
|
4791
4824
|
};
|
|
4792
4825
|
const getGeckoBinaryErrorMessage = ()=>this.host.geckoBinary ? messages.Dh(this.host.geckoBinary) : messages.jk();
|
|
@@ -4910,7 +4943,8 @@ var __webpack_modules__ = {
|
|
|
4910
4943
|
this.child = await this.spawnFirefoxChild(binary, args, wslFallbackBinary);
|
|
4911
4944
|
(0, ready_stamp.M)(this.extensionOutputPath, {
|
|
4912
4945
|
profilePath,
|
|
4913
|
-
browserPid: this.child?.pid
|
|
4946
|
+
browserPid: this.child?.pid,
|
|
4947
|
+
extensionId: this.extensionOutputPath ? (0, banner.MT)(this.extensionOutputPath) : void 0
|
|
4914
4948
|
});
|
|
4915
4949
|
this.child.on('close', ()=>{
|
|
4916
4950
|
(0, shared_utils.sW)(profilePath);
|
|
@@ -4934,6 +4968,7 @@ var __webpack_modules__ = {
|
|
|
4934
4968
|
this.host.rdpController = ctrl;
|
|
4935
4969
|
this.ctx.setController(ctrl);
|
|
4936
4970
|
(0, ready_stamp.__)(this.extensionOutputPath, debugPort);
|
|
4971
|
+
(0, ready_stamp.hg)(this.extensionOutputPath, ctrl.getExtensionId());
|
|
4937
4972
|
this.scheduleWatchTimeout();
|
|
4938
4973
|
try {
|
|
4939
4974
|
if ((0, messaging._o)()) {
|
|
@@ -4961,7 +4996,8 @@ var __webpack_modules__ = {
|
|
|
4961
4996
|
];
|
|
4962
4997
|
this.child = await this.spawnFirefoxChild(binaryPath, args, wslFallbackBinary);
|
|
4963
4998
|
(0, ready_stamp.M)(this.extensionOutputPath, {
|
|
4964
|
-
browserPid: this.child?.pid
|
|
4999
|
+
browserPid: this.child?.pid,
|
|
5000
|
+
extensionId: this.extensionOutputPath ? (0, banner.MT)(this.extensionOutputPath) : void 0
|
|
4965
5001
|
});
|
|
4966
5002
|
this.wireChildLifecycle();
|
|
4967
5003
|
if (debugPort > 0) (0, ready_stamp.__)(this.extensionOutputPath, debugPort);
|
|
@@ -5033,6 +5069,7 @@ var __webpack_modules__ = {
|
|
|
5033
5069
|
this.host.rdpController = ctrl;
|
|
5034
5070
|
this.ctx.setController(ctrl);
|
|
5035
5071
|
this.host.extensionLoadRefused = void 0;
|
|
5072
|
+
(0, ready_stamp.hg)(this.extensionOutputPath, ctrl.getExtensionId());
|
|
5036
5073
|
return {
|
|
5037
5074
|
status: 'loaded'
|
|
5038
5075
|
};
|
|
@@ -5048,7 +5085,7 @@ var __webpack_modules__ = {
|
|
|
5048
5085
|
}
|
|
5049
5086
|
reportAddonLoadRefused(reason) {
|
|
5050
5087
|
const refusedPath = this.extensionOutputPath || '';
|
|
5051
|
-
|
|
5088
|
+
(0, messaging.Gg)(messages.EE(refusedPath, reason));
|
|
5052
5089
|
this.host.logSink?.({
|
|
5053
5090
|
level: 'error',
|
|
5054
5091
|
text: `extension_load_refused: ${refusedPath}${reason ? ` - ${reason}` : ''}`,
|
|
@@ -5082,9 +5119,9 @@ var __webpack_modules__ = {
|
|
|
5082
5119
|
try {
|
|
5083
5120
|
const displayCacheDir = (0, output_binaries_resolver.LB)(compilation);
|
|
5084
5121
|
const pretty = messages.MG(this.host.browser || 'firefox', raw, displayCacheDir);
|
|
5085
|
-
|
|
5122
|
+
(0, messaging.Gg)(pretty);
|
|
5086
5123
|
} catch {
|
|
5087
|
-
|
|
5124
|
+
(0, messaging.Gg)(raw);
|
|
5088
5125
|
}
|
|
5089
5126
|
}
|
|
5090
5127
|
constructor(host, ctx){
|
|
@@ -5248,10 +5285,10 @@ var __webpack_modules__ = {
|
|
|
5248
5285
|
var messaging = __webpack_require__("./helpers/messaging.ts");
|
|
5249
5286
|
var messages = __webpack_require__("./browsers/browsers-lib/messages.ts");
|
|
5250
5287
|
function logSafariDryRun(converterCmd, xcodebuildCmd) {
|
|
5251
|
-
if ((0, messaging._o)())
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5288
|
+
if ((0, messaging._o)()) (0, messaging._w)(messages.KP());
|
|
5289
|
+
(0, messaging._w)(messages.yc());
|
|
5290
|
+
(0, messaging._w)(messages.fL(converterCmd));
|
|
5291
|
+
(0, messaging._w)(messages.Aj(xcodebuildCmd));
|
|
5255
5292
|
}
|
|
5256
5293
|
var safari_config = __webpack_require__("./browsers/run-safari/safari-launch/safari-config.ts");
|
|
5257
5294
|
function isMacOS() {
|
|
@@ -5313,9 +5350,9 @@ var __webpack_modules__ = {
|
|
|
5313
5350
|
}
|
|
5314
5351
|
function fallbackLogger() {
|
|
5315
5352
|
return {
|
|
5316
|
-
info: (...a)=>
|
|
5317
|
-
warn: (...a)=>
|
|
5318
|
-
error: (...a)=>
|
|
5353
|
+
info: (...a)=>(0, messaging._w)(...a),
|
|
5354
|
+
warn: (...a)=>(0, messaging.mR)(...a),
|
|
5355
|
+
error: (...a)=>(0, messaging.Gg)(...a),
|
|
5319
5356
|
debug: (...a)=>console?.debug?.(...a)
|
|
5320
5357
|
};
|
|
5321
5358
|
}
|
|
@@ -5416,6 +5453,7 @@ var __webpack_modules__ = {
|
|
|
5416
5453
|
const config = (0, safari_config.F7)(compilation, host);
|
|
5417
5454
|
const converterArgs = (0, safari_config.w7)(config);
|
|
5418
5455
|
const xcodebuildArgs = (0, safari_config.vx)(config);
|
|
5456
|
+
if ('full' === mode && config.bundleIdDerived) logger.warn?.(messages.$q(config.bundleIdentifier));
|
|
5419
5457
|
if (host.dryRun || isTestEnv()) {
|
|
5420
5458
|
logSafariDryRun(`xcrun ${converterArgs.join(' ')}`, `xcodebuild ${xcodebuildArgs.join(' ')}`);
|
|
5421
5459
|
return describePackage(config);
|
|
@@ -5473,7 +5511,6 @@ var __webpack_modules__ = {
|
|
|
5473
5511
|
return describePackage(config);
|
|
5474
5512
|
}
|
|
5475
5513
|
logger.info?.(messages.Rl(appPath));
|
|
5476
|
-
if (config.bundleIdDerived) logger.info?.(messages.$q(config.bundleIdentifier));
|
|
5477
5514
|
if (!config.open) {
|
|
5478
5515
|
logger.info?.(messages.aO(appPath, config.appName));
|
|
5479
5516
|
return describePackage(config);
|
|
@@ -5489,7 +5526,7 @@ var __webpack_modules__ = {
|
|
|
5489
5526
|
]);
|
|
5490
5527
|
logger.info?.(messages.fO(config.appName));
|
|
5491
5528
|
if (await confirmRegisteredWithSafari(config.bundleIdentifier)) logger.info?.(messages.fd(config.appName));
|
|
5492
|
-
else logger.
|
|
5529
|
+
else logger.info?.(messages.qY(config.appName));
|
|
5493
5530
|
return describePackage(config);
|
|
5494
5531
|
}
|
|
5495
5532
|
async function packageSafariExtension(host, outputPath, logger, mode = 'full') {
|
|
@@ -5751,6 +5788,24 @@ var __webpack_modules__ = {
|
|
|
5751
5788
|
if ('debug' === type) return pintor__rspack_import_0_default().dim(pintor__rspack_import_0_default().gray(DEBUG_GLYPH));
|
|
5752
5789
|
return pintor__rspack_import_0_default().gray(GLYPH);
|
|
5753
5790
|
}
|
|
5791
|
+
const MACHINE_OUTPUT_VALUES = new Set([
|
|
5792
|
+
'json',
|
|
5793
|
+
'ndjson'
|
|
5794
|
+
]);
|
|
5795
|
+
function isMachineOutput() {
|
|
5796
|
+
return MACHINE_OUTPUT_VALUES.has(String(process.env.EXTENSION_OUTPUT || '').trim().toLowerCase());
|
|
5797
|
+
}
|
|
5798
|
+
function humanLine(...parts) {
|
|
5799
|
+
if (isMachineOutput()) return;
|
|
5800
|
+
console.log(...parts);
|
|
5801
|
+
}
|
|
5802
|
+
function humanWarn(...parts) {
|
|
5803
|
+
if (isMachineOutput()) return;
|
|
5804
|
+
console.warn(...parts);
|
|
5805
|
+
}
|
|
5806
|
+
function humanError(...parts) {
|
|
5807
|
+
console.error(...parts);
|
|
5808
|
+
}
|
|
5754
5809
|
const fmt = {
|
|
5755
5810
|
heading: (title)=>pintor__rspack_import_0_default().underline(pintor__rspack_import_0_default().blue(title)),
|
|
5756
5811
|
label: (key)=>pintor__rspack_import_0_default().gray(key.toUpperCase()),
|
|
@@ -5987,11 +6042,14 @@ var __webpack_modules__ = {
|
|
|
5987
6042
|
};
|
|
5988
6043
|
__webpack_require__.d(__webpack_exports__, {
|
|
5989
6044
|
A6: ()=>browserRowValue,
|
|
6045
|
+
Gg: ()=>humanError,
|
|
5990
6046
|
Nr: ()=>card,
|
|
5991
6047
|
Pl: ()=>prefix,
|
|
5992
6048
|
T_: ()=>artifactNoun,
|
|
5993
6049
|
VR: ()=>isCardKeyClaimed,
|
|
5994
6050
|
_o: ()=>isDebug,
|
|
6051
|
+
_w: ()=>humanLine,
|
|
6052
|
+
mR: ()=>humanWarn,
|
|
5995
6053
|
od: ()=>claimCardKey
|
|
5996
6054
|
}, {
|
|
5997
6055
|
Lp: CODES,
|
|
@@ -7544,6 +7602,17 @@ Cross-browser compatibility
|
|
|
7544
7602
|
console.log(JSON.stringify(frame));
|
|
7545
7603
|
}
|
|
7546
7604
|
}
|
|
7605
|
+
async function resolveNoBrowser(projectPath, command) {
|
|
7606
|
+
if ('1' === process.env.EXTENSION_CLI_NO_BROWSER) return true;
|
|
7607
|
+
try {
|
|
7608
|
+
const develop = await loadExtensionDevelopModule();
|
|
7609
|
+
if ('function' != typeof develop.loadCommandConfig) return false;
|
|
7610
|
+
const config = await develop.loadCommandConfig(projectPath, command);
|
|
7611
|
+
return config?.noBrowser === true;
|
|
7612
|
+
} catch {
|
|
7613
|
+
return false;
|
|
7614
|
+
}
|
|
7615
|
+
}
|
|
7547
7616
|
let warnedDeprecatedAlias = false;
|
|
7548
7617
|
function warnDeprecatedOutputAlias(flag) {
|
|
7549
7618
|
if (warnedDeprecatedAlias) return;
|
|
@@ -7884,7 +7953,7 @@ Cross-browser compatibility
|
|
|
7884
7953
|
}));
|
|
7885
7954
|
return;
|
|
7886
7955
|
}
|
|
7887
|
-
const noBrowser =
|
|
7956
|
+
const noBrowser = await resolveNoBrowser(pathOrRemoteUrl || process.cwd(), 'dev');
|
|
7888
7957
|
if (asJson) printFrame(messaging.Pr.ok('dev', 'started', {
|
|
7889
7958
|
projectPath: pathOrRemoteUrl || process.cwd(),
|
|
7890
7959
|
browser: list[0],
|
|
@@ -8532,7 +8601,7 @@ Cross-browser compatibility
|
|
|
8532
8601
|
geckoBinary: previewOptions.geckoBinary,
|
|
8533
8602
|
startingUrl: previewOptions.startingUrl,
|
|
8534
8603
|
port: previewOptions.port,
|
|
8535
|
-
noBrowser:
|
|
8604
|
+
noBrowser: await resolveNoBrowser(pathOrRemoteUrl || process.cwd(), 'preview'),
|
|
8536
8605
|
extensions: parseExtensionsList(previewOptions.extensions),
|
|
8537
8606
|
logLevel: logsOption || previewOptions.logLevel || 'off',
|
|
8538
8607
|
logContexts,
|
|
@@ -8715,7 +8784,7 @@ Cross-browser compatibility
|
|
|
8715
8784
|
browsers: list,
|
|
8716
8785
|
port: start_resolveRequestedPort(startOptions.port),
|
|
8717
8786
|
pid: process.pid,
|
|
8718
|
-
noBrowser:
|
|
8787
|
+
noBrowser: await resolveNoBrowser(pathOrRemoteUrl || process.cwd(), 'start')
|
|
8719
8788
|
}));
|
|
8720
8789
|
const { extensionBuild } = await loadExtensionDevelopModule();
|
|
8721
8790
|
for (const vendor of list){
|
|
@@ -8743,7 +8812,7 @@ Cross-browser compatibility
|
|
|
8743
8812
|
}));
|
|
8744
8813
|
process.exit(1);
|
|
8745
8814
|
}
|
|
8746
|
-
const noBrowser =
|
|
8815
|
+
const noBrowser = await resolveNoBrowser(pathOrRemoteUrl || process.cwd(), 'start');
|
|
8747
8816
|
if (noBrowser) continue;
|
|
8748
8817
|
const { extensionPreview } = await loadExtensionDevelopPreviewModule();
|
|
8749
8818
|
await extensionPreview(pathOrRemoteUrl, {
|
|
@@ -8886,6 +8955,10 @@ Cross-browser compatibility
|
|
|
8886
8955
|
if (!raw) return false;
|
|
8887
8956
|
return '0' === raw || 'false' === raw || 'off' === raw || 'no' === raw;
|
|
8888
8957
|
}
|
|
8958
|
+
function envExplicitlyEnables() {
|
|
8959
|
+
const raw = String(process.env.EXTENSION_TELEMETRY ?? '').trim().toLowerCase();
|
|
8960
|
+
return '1' === raw || 'true' === raw || 'on' === raw || 'yes' === raw;
|
|
8961
|
+
}
|
|
8889
8962
|
function resolveTelemetryConsent(argv = process.argv) {
|
|
8890
8963
|
if (envDisables()) return {
|
|
8891
8964
|
enabled: false,
|
|
@@ -8895,6 +8968,10 @@ Cross-browser compatibility
|
|
|
8895
8968
|
enabled: false,
|
|
8896
8969
|
source: 'flag'
|
|
8897
8970
|
};
|
|
8971
|
+
if (envExplicitlyEnables()) return {
|
|
8972
|
+
enabled: true,
|
|
8973
|
+
source: 'env'
|
|
8974
|
+
};
|
|
8898
8975
|
const storage = resolveTelemetryStorage();
|
|
8899
8976
|
if (storage) {
|
|
8900
8977
|
const stored = readConsentFile(storage.consentFile);
|
|
@@ -8907,6 +8984,10 @@ Cross-browser compatibility
|
|
|
8907
8984
|
source: 'config'
|
|
8908
8985
|
};
|
|
8909
8986
|
}
|
|
8987
|
+
if (isCI() && !process.stdout.isTTY) return {
|
|
8988
|
+
enabled: false,
|
|
8989
|
+
source: 'ci'
|
|
8990
|
+
};
|
|
8910
8991
|
return {
|
|
8911
8992
|
enabled: true,
|
|
8912
8993
|
source: 'default'
|