tnp-core 19.0.51 → 19.0.52
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/browser/fesm2022/tnp-core.mjs +7 -16
- package/browser/fesm2022/tnp-core.mjs.map +1 -1
- package/browser/package.json +1 -1
- package/cli.backend.js +2 -2
- package/lib/build-info._auto-generated_.d.ts +2 -1
- package/lib/build-info._auto-generated_.js +3 -2
- package/lib/build-info._auto-generated_.js.map +1 -1
- package/lib/node-chalk-mock.js +2 -2
- package/lib/node-path-mock.js +2 -2
- package/lib/utils.js +7 -16
- package/lib/utils.js.map +1 -1
- package/package.json +1 -1
- package/websql/fesm2022/tnp-core.mjs +7 -16
- package/websql/fesm2022/tnp-core.mjs.map +1 -1
- package/websql/package.json +1 -1
@@ -2377,28 +2377,19 @@ var UtilsOs;
|
|
2377
2377
|
* Electron backend or browser.
|
2378
2378
|
*/
|
2379
2379
|
UtilsOs.isRunningInElectron = () => {
|
2380
|
-
|
2381
|
-
|
2382
|
-
}
|
2383
|
-
// Renderer process
|
2384
|
-
// @ts-ignore
|
2385
|
-
if (typeof window !== 'undefined' &&
|
2386
|
-
typeof window.process === 'object' &&
|
2387
|
-
// @ts-ignore
|
2388
|
-
window.process.type === 'renderer') {
|
2380
|
+
// Electron main or renderer (most reliable)
|
2381
|
+
if (typeof process !== 'undefined' && process?.versions?.electron) {
|
2389
2382
|
return true;
|
2390
2383
|
}
|
2391
|
-
//
|
2392
|
-
|
2393
|
-
|
2394
|
-
typeof process.versions === 'object' &&
|
2395
|
-
!!process.versions.electron) {
|
2384
|
+
// Renderer with nodeIntegration
|
2385
|
+
if (typeof globalThis !== 'undefined' &&
|
2386
|
+
globalThis?.process?.type === 'renderer') {
|
2396
2387
|
return true;
|
2397
2388
|
}
|
2398
|
-
//
|
2389
|
+
// Renderer with nodeIntegration disabled
|
2399
2390
|
if (typeof navigator === 'object' &&
|
2400
2391
|
typeof navigator.userAgent === 'string' &&
|
2401
|
-
navigator.userAgent
|
2392
|
+
/Electron/i.test(navigator.userAgent)) {
|
2402
2393
|
return true;
|
2403
2394
|
}
|
2404
2395
|
return false;
|