@lvce-editor/main-process 6.11.1 → 6.13.0
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/mainProcessMain.js +139 -92
- package/package.json +1 -1
package/dist/mainProcessMain.js
CHANGED
|
@@ -5,10 +5,10 @@ import { fileURLToPath } from 'node:url';
|
|
|
5
5
|
import { inspect } from 'node:util';
|
|
6
6
|
import { spawn } from 'node:child_process';
|
|
7
7
|
import { Console } from 'node:console';
|
|
8
|
-
import { createWriteStream, readFileSync, openAsBlob, existsSync,
|
|
9
|
-
import { tmpdir, homedir } from 'node:os';
|
|
8
|
+
import { mkdirSync, createWriteStream, readFileSync, openAsBlob, existsSync, openSync, writeSync, closeSync, rmSync } from 'node:fs';
|
|
10
9
|
import * as NodePath from 'node:path';
|
|
11
10
|
import { dirname, join as join$1 } from 'node:path';
|
|
11
|
+
import { homedir, tmpdir } from 'node:os';
|
|
12
12
|
import { MessageChannel } from 'node:worker_threads';
|
|
13
13
|
|
|
14
14
|
const scheme = 'lvce-oss';
|
|
@@ -778,53 +778,92 @@ const getNewLineIndex$2 = (string, startIndex = undefined) => {
|
|
|
778
778
|
return string.indexOf('\n', startIndex);
|
|
779
779
|
};
|
|
780
780
|
|
|
781
|
+
const join = (...paths) => {
|
|
782
|
+
return NodePath.join(...paths);
|
|
783
|
+
};
|
|
784
|
+
|
|
785
|
+
const __dirname$1 = dirname(fileURLToPath(import.meta.url));
|
|
786
|
+
const root = process.env.LVCE_ROOT || join(__dirname$1, '../../../../..');
|
|
787
|
+
|
|
788
|
+
const {
|
|
789
|
+
env,
|
|
790
|
+
platform
|
|
791
|
+
} = process;
|
|
792
|
+
const isLinux = platform === 'linux';
|
|
793
|
+
const isProduction = false;
|
|
794
|
+
const homeDirectory = homedir();
|
|
795
|
+
|
|
796
|
+
const xdgCache = env.XDG_CACHE_HOME || (homeDirectory ? join(homeDirectory, '.cache') : undefined);
|
|
797
|
+
const xdgData = env.XDG_DATA_HOME || (homeDirectory ? join(homeDirectory, '.local', 'share') : undefined);
|
|
798
|
+
join(xdgData || tmpdir(), applicationName);
|
|
799
|
+
const xdgState = env.XDG_STATE_HOME || (homeDirectory ? join(homeDirectory, '.local', 'state') : undefined);
|
|
800
|
+
const logsDir = join(xdgState || tmpdir(), applicationName, 'logs');
|
|
801
|
+
const chromeUserDataPath = xdgCache ? join(xdgCache, applicationName, 'userdata') : '';
|
|
802
|
+
|
|
803
|
+
const useIpcForResponse = true;
|
|
804
|
+
const getSessionId = () => {
|
|
805
|
+
return process.env.SESSION_ID || `persist:${scheme}`;
|
|
806
|
+
};
|
|
807
|
+
const getSharedProcessPath = () => {
|
|
808
|
+
if (process.env.LVCE_SHARED_PROCESS_PATH) {
|
|
809
|
+
return process.env.LVCE_SHARED_PROCESS_PATH;
|
|
810
|
+
}
|
|
811
|
+
return join(root, 'packages', 'shared-process', 'src', 'sharedProcessMain.ts');
|
|
812
|
+
};
|
|
813
|
+
|
|
814
|
+
const createFileLogger = fileName => {
|
|
815
|
+
mkdirSync(logsDir, {
|
|
816
|
+
recursive: true
|
|
817
|
+
});
|
|
818
|
+
const logFile = join(logsDir, fileName);
|
|
819
|
+
const writeStream = createWriteStream(logFile);
|
|
820
|
+
return new Console(writeStream);
|
|
821
|
+
};
|
|
822
|
+
|
|
781
823
|
// TODO disable logging via environment variable, don't enable logging during tests
|
|
782
824
|
|
|
783
|
-
const state$
|
|
825
|
+
const state$7 = {
|
|
784
826
|
console: undefined
|
|
785
827
|
};
|
|
786
828
|
const createConsole = () => {
|
|
787
|
-
|
|
788
|
-
const writeStream = createWriteStream(logFile);
|
|
789
|
-
const logger = new Console(writeStream);
|
|
790
|
-
return logger;
|
|
829
|
+
return createFileLogger('log-main-process.txt');
|
|
791
830
|
};
|
|
792
|
-
const getOrCreateLogger = () => {
|
|
793
|
-
state$
|
|
794
|
-
return state$
|
|
831
|
+
const getOrCreateLogger$1 = () => {
|
|
832
|
+
state$7.console ||= createConsole();
|
|
833
|
+
return state$7.console;
|
|
795
834
|
};
|
|
796
835
|
const info = (...args) => {
|
|
797
|
-
const logger = getOrCreateLogger();
|
|
836
|
+
const logger = getOrCreateLogger$1();
|
|
798
837
|
logger.info(...args);
|
|
799
838
|
console.info(...args);
|
|
800
839
|
};
|
|
801
840
|
const error = (...args) => {
|
|
802
|
-
const logger = getOrCreateLogger();
|
|
841
|
+
const logger = getOrCreateLogger$1();
|
|
803
842
|
logger.error(...args);
|
|
804
843
|
console.error(...args);
|
|
805
844
|
};
|
|
806
845
|
process.stdout.on('close', () => {
|
|
807
|
-
const logger = getOrCreateLogger();
|
|
846
|
+
const logger = getOrCreateLogger$1();
|
|
808
847
|
logger.info('stdout closed');
|
|
809
848
|
});
|
|
810
849
|
process.stdout.on('exit', () => {
|
|
811
|
-
const logger = getOrCreateLogger();
|
|
850
|
+
const logger = getOrCreateLogger$1();
|
|
812
851
|
logger.info('stdout exited');
|
|
813
852
|
});
|
|
814
853
|
process.stderr.on('close', () => {
|
|
815
|
-
const logger = getOrCreateLogger();
|
|
854
|
+
const logger = getOrCreateLogger$1();
|
|
816
855
|
logger.info('stderr closed');
|
|
817
856
|
});
|
|
818
857
|
process.stderr.on('exit', () => {
|
|
819
|
-
const logger = getOrCreateLogger();
|
|
858
|
+
const logger = getOrCreateLogger$1();
|
|
820
859
|
logger.info('stderr exited');
|
|
821
860
|
});
|
|
822
861
|
process.stdout.on('error', error => {
|
|
823
|
-
const logger = getOrCreateLogger();
|
|
862
|
+
const logger = getOrCreateLogger$1();
|
|
824
863
|
logger.error(`[main-process] stdout error: ${error.stack}`);
|
|
825
864
|
});
|
|
826
865
|
process.stderr.on('error', error => {
|
|
827
|
-
const logger = getOrCreateLogger();
|
|
866
|
+
const logger = getOrCreateLogger$1();
|
|
828
867
|
logger.error(`[main-process] stderr error: ${error.stack}`);
|
|
829
868
|
});
|
|
830
869
|
|
|
@@ -2271,7 +2310,7 @@ const IpcChildWithRendererProcess2$1 = {
|
|
|
2271
2310
|
listen: listen$2,
|
|
2272
2311
|
wrap: wrap$a
|
|
2273
2312
|
};
|
|
2274
|
-
const addListener = (emitter, type, callback) => {
|
|
2313
|
+
const addListener$1 = (emitter, type, callback) => {
|
|
2275
2314
|
if ('addEventListener' in emitter) {
|
|
2276
2315
|
emitter.addEventListener(type, callback);
|
|
2277
2316
|
} else {
|
|
@@ -2304,7 +2343,7 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
2304
2343
|
type
|
|
2305
2344
|
});
|
|
2306
2345
|
};
|
|
2307
|
-
addListener(eventEmitter, event, listener);
|
|
2346
|
+
addListener$1(eventEmitter, event, listener);
|
|
2308
2347
|
listenerMap[event] = listener;
|
|
2309
2348
|
}
|
|
2310
2349
|
return promise;
|
|
@@ -2784,10 +2823,12 @@ const get$4 = id => {
|
|
|
2784
2823
|
const remove$2 = id => {
|
|
2785
2824
|
delete callbacks[id];
|
|
2786
2825
|
};
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
return
|
|
2790
|
-
|
|
2826
|
+
const create$3$1 = (() => {
|
|
2827
|
+
let id = 0;
|
|
2828
|
+
return () => {
|
|
2829
|
+
return ++id;
|
|
2830
|
+
};
|
|
2831
|
+
})();
|
|
2791
2832
|
const registerPromise$1 = () => {
|
|
2792
2833
|
const id = create$3$1();
|
|
2793
2834
|
const {
|
|
@@ -2861,7 +2902,10 @@ const constructError = (message, type, name) => {
|
|
|
2861
2902
|
if (ErrorConstructor === Error) {
|
|
2862
2903
|
const error = new Error(message);
|
|
2863
2904
|
if (name && name !== 'VError') {
|
|
2864
|
-
error
|
|
2905
|
+
Object.defineProperty(error, 'name', {
|
|
2906
|
+
configurable: true,
|
|
2907
|
+
value: name
|
|
2908
|
+
});
|
|
2865
2909
|
}
|
|
2866
2910
|
return error;
|
|
2867
2911
|
}
|
|
@@ -2892,31 +2936,45 @@ const getParentStack = error => {
|
|
|
2892
2936
|
};
|
|
2893
2937
|
const MethodNotFound = -32601;
|
|
2894
2938
|
const Custom = -32001;
|
|
2939
|
+
const setStack = (error, stack) => {
|
|
2940
|
+
const descriptor = Object.getOwnPropertyDescriptor(error, 'stack');
|
|
2941
|
+
if (descriptor) {
|
|
2942
|
+
if (!descriptor.configurable && !descriptor.writable) {
|
|
2943
|
+
return;
|
|
2944
|
+
}
|
|
2945
|
+
if (!descriptor.configurable && descriptor.writable) {
|
|
2946
|
+
error.stack = stack;
|
|
2947
|
+
return;
|
|
2948
|
+
}
|
|
2949
|
+
}
|
|
2950
|
+
Object.defineProperty(error, 'stack', {
|
|
2951
|
+
configurable: true,
|
|
2952
|
+
value: stack,
|
|
2953
|
+
writable: true
|
|
2954
|
+
});
|
|
2955
|
+
};
|
|
2895
2956
|
const restoreExistingError = (error, currentStack) => {
|
|
2896
2957
|
if (typeof error.stack === 'string') {
|
|
2897
|
-
error
|
|
2958
|
+
setStack(error, `${error.stack}${NewLine}${currentStack}`);
|
|
2898
2959
|
}
|
|
2899
2960
|
return error;
|
|
2900
2961
|
};
|
|
2901
2962
|
const restoreMethodNotFoundError = (error, currentStack) => {
|
|
2902
2963
|
const restoredError = new JsonRpcError(error.message);
|
|
2903
2964
|
const parentStack = getParentStack(error);
|
|
2904
|
-
restoredError
|
|
2965
|
+
setStack(restoredError, `${parentStack}${NewLine}${currentStack}`);
|
|
2905
2966
|
return restoredError;
|
|
2906
2967
|
};
|
|
2907
2968
|
const restoreStackFromData = (restoredError, error, currentStack) => {
|
|
2908
2969
|
if (error.data.stack && error.data.type && error.message) {
|
|
2909
|
-
restoredError
|
|
2970
|
+
setStack(restoredError, `${error.data.type}: ${error.message}${NewLine}${error.data.stack}${NewLine}${currentStack}`);
|
|
2910
2971
|
return;
|
|
2911
2972
|
}
|
|
2912
2973
|
if (error.data.stack) {
|
|
2913
|
-
restoredError
|
|
2974
|
+
setStack(restoredError, error.data.stack);
|
|
2914
2975
|
}
|
|
2915
2976
|
};
|
|
2916
2977
|
const applyDataProperties = (restoredError, error) => {
|
|
2917
|
-
if (!error.data) {
|
|
2918
|
-
return;
|
|
2919
|
-
}
|
|
2920
2978
|
restoreStackFromData(restoredError, error, getCurrentStack());
|
|
2921
2979
|
if (error.data.codeFrame) {
|
|
2922
2980
|
// @ts-ignore
|
|
@@ -2937,7 +2995,7 @@ const applyDirectProperties = (restoredError, error) => {
|
|
|
2937
2995
|
const indexNewLine = getNewLineIndex(lowerStack);
|
|
2938
2996
|
const parentStack = getParentStack(error);
|
|
2939
2997
|
// @ts-ignore
|
|
2940
|
-
restoredError
|
|
2998
|
+
setStack(restoredError, `${parentStack}${lowerStack.slice(indexNewLine)}`);
|
|
2941
2999
|
}
|
|
2942
3000
|
if (error.codeFrame) {
|
|
2943
3001
|
// @ts-ignore
|
|
@@ -3363,27 +3421,27 @@ const formatUtilityProcessName = name => {
|
|
|
3363
3421
|
return camelCase(name);
|
|
3364
3422
|
};
|
|
3365
3423
|
|
|
3366
|
-
const state$
|
|
3424
|
+
const state$6 = {
|
|
3367
3425
|
all: Object.create(null)
|
|
3368
3426
|
};
|
|
3369
3427
|
const add$1 = (pid, process, name) => {
|
|
3370
3428
|
number(pid);
|
|
3371
3429
|
object(process);
|
|
3372
3430
|
string(name);
|
|
3373
|
-
state$
|
|
3431
|
+
state$6.all[pid] = {
|
|
3374
3432
|
name,
|
|
3375
3433
|
process
|
|
3376
3434
|
};
|
|
3377
3435
|
};
|
|
3378
3436
|
const remove$1 = pid => {
|
|
3379
3437
|
number(pid);
|
|
3380
|
-
delete state$
|
|
3438
|
+
delete state$6.all[pid];
|
|
3381
3439
|
};
|
|
3382
3440
|
const getAll = () => {
|
|
3383
|
-
return Object.entries(state$
|
|
3441
|
+
return Object.entries(state$6.all);
|
|
3384
3442
|
};
|
|
3385
3443
|
const getByName = name => {
|
|
3386
|
-
for (const value of Object.values(state$
|
|
3444
|
+
for (const value of Object.values(state$6.all)) {
|
|
3387
3445
|
// @ts-ignore
|
|
3388
3446
|
if (value.name === name) {
|
|
3389
3447
|
// @ts-ignore
|
|
@@ -3473,37 +3531,6 @@ const DidStartSharedProcess = 'code/didStartSharedProcess';
|
|
|
3473
3531
|
const WillCreateCodeWindow = 'code/willCreateCodeWindow';
|
|
3474
3532
|
const DidCreateCodeWindow = 'code/didCreateCodeWindow';
|
|
3475
3533
|
|
|
3476
|
-
const join = (...paths) => {
|
|
3477
|
-
return NodePath.join(...paths);
|
|
3478
|
-
};
|
|
3479
|
-
|
|
3480
|
-
const __dirname$1 = dirname(fileURLToPath(import.meta.url));
|
|
3481
|
-
const root = process.env.LVCE_ROOT || join(__dirname$1, '../../../../..');
|
|
3482
|
-
|
|
3483
|
-
const {
|
|
3484
|
-
env,
|
|
3485
|
-
platform
|
|
3486
|
-
} = process;
|
|
3487
|
-
const isLinux = platform === 'linux';
|
|
3488
|
-
const isProduction = false;
|
|
3489
|
-
const homeDirectory = homedir();
|
|
3490
|
-
|
|
3491
|
-
const xdgCache = env.XDG_CACHE_HOME || (homeDirectory ? join(homeDirectory, '.cache') : undefined);
|
|
3492
|
-
const xdgData = env.XDG_DATA_HOME || (homeDirectory ? join(homeDirectory, '.local', 'share') : undefined);
|
|
3493
|
-
join(xdgData || tmpdir(), applicationName);
|
|
3494
|
-
const chromeUserDataPath = xdgCache ? join(xdgCache, applicationName, 'userdata') : '';
|
|
3495
|
-
|
|
3496
|
-
const useIpcForResponse = true;
|
|
3497
|
-
const getSessionId = () => {
|
|
3498
|
-
return process.env.SESSION_ID || `persist:${scheme}`;
|
|
3499
|
-
};
|
|
3500
|
-
const getSharedProcessPath = () => {
|
|
3501
|
-
if (process.env.LVCE_SHARED_PROCESS_PATH) {
|
|
3502
|
-
return process.env.LVCE_SHARED_PROCESS_PATH;
|
|
3503
|
-
}
|
|
3504
|
-
return join(root, 'packages', 'shared-process', 'src', 'sharedProcessMain.ts');
|
|
3505
|
-
};
|
|
3506
|
-
|
|
3507
3534
|
const requiresSocket = () => {
|
|
3508
3535
|
return false;
|
|
3509
3536
|
};
|
|
@@ -3567,7 +3594,7 @@ const launchSharedProcess = async ({
|
|
|
3567
3594
|
return sharedProcessRpc;
|
|
3568
3595
|
};
|
|
3569
3596
|
|
|
3570
|
-
const state$
|
|
3597
|
+
const state$5 = {
|
|
3571
3598
|
/**
|
|
3572
3599
|
* @type {any}
|
|
3573
3600
|
*/
|
|
@@ -3578,14 +3605,14 @@ const getOrCreate = async ({
|
|
|
3578
3605
|
env = {},
|
|
3579
3606
|
method
|
|
3580
3607
|
}) => {
|
|
3581
|
-
if (!state$
|
|
3608
|
+
if (!state$5.promise) {
|
|
3582
3609
|
// @ts-ignore
|
|
3583
|
-
state$
|
|
3610
|
+
state$5.promise = launchSharedProcess({
|
|
3584
3611
|
env,
|
|
3585
3612
|
method
|
|
3586
3613
|
});
|
|
3587
3614
|
}
|
|
3588
|
-
return state$
|
|
3615
|
+
return state$5.promise;
|
|
3589
3616
|
};
|
|
3590
3617
|
const send$1 = async (method, ...params) => {
|
|
3591
3618
|
const rpc = await getOrCreate({
|
|
@@ -3749,14 +3776,14 @@ const createTitleBar = items => {
|
|
|
3749
3776
|
|
|
3750
3777
|
const PHASE_DEFAULT = 0;
|
|
3751
3778
|
const PHASE_SHUTDOWN = -1;
|
|
3752
|
-
const state$
|
|
3779
|
+
const state$4 = {
|
|
3753
3780
|
phase: PHASE_DEFAULT
|
|
3754
3781
|
};
|
|
3755
3782
|
const isShutDown = () => {
|
|
3756
|
-
return state$
|
|
3783
|
+
return state$4.phase === PHASE_SHUTDOWN;
|
|
3757
3784
|
};
|
|
3758
3785
|
const setShutDown = () => {
|
|
3759
|
-
state$
|
|
3786
|
+
state$4.phase = PHASE_SHUTDOWN;
|
|
3760
3787
|
};
|
|
3761
3788
|
|
|
3762
3789
|
// TODO move this function to shared process
|
|
@@ -4054,21 +4081,21 @@ const openExternal = async url => {
|
|
|
4054
4081
|
await shell.openExternal(url);
|
|
4055
4082
|
};
|
|
4056
4083
|
|
|
4057
|
-
const state$
|
|
4084
|
+
const state$3 = {
|
|
4058
4085
|
canceled: Object.create(null),
|
|
4059
4086
|
fallThroughKeyBindings: [],
|
|
4060
4087
|
views: Object.create(null)
|
|
4061
4088
|
};
|
|
4062
4089
|
const add = (id, browserWindow, view) => {
|
|
4063
4090
|
// state
|
|
4064
|
-
state$
|
|
4091
|
+
state$3.views[id] = {
|
|
4065
4092
|
browserWindow,
|
|
4066
4093
|
view
|
|
4067
4094
|
};
|
|
4068
4095
|
};
|
|
4069
4096
|
const hasWebContents = id => {
|
|
4070
4097
|
number(id);
|
|
4071
|
-
return id in state$
|
|
4098
|
+
return id in state$3.views;
|
|
4072
4099
|
};
|
|
4073
4100
|
/**
|
|
4074
4101
|
*
|
|
@@ -4076,19 +4103,19 @@ const hasWebContents = id => {
|
|
|
4076
4103
|
* @returns {{browserWindow: Electron.BrowserWindow, view: Electron.WebContentsView}}
|
|
4077
4104
|
*/
|
|
4078
4105
|
const get$3 = id => {
|
|
4079
|
-
return state$
|
|
4106
|
+
return state$3.views[id];
|
|
4080
4107
|
};
|
|
4081
4108
|
const remove = id => {
|
|
4082
|
-
delete state$
|
|
4109
|
+
delete state$3.views[id];
|
|
4083
4110
|
};
|
|
4084
4111
|
const setFallthroughKeyBindings = fallthroughKeyBindings => {
|
|
4085
|
-
state$
|
|
4112
|
+
state$3.fallThroughKeyBindings = fallthroughKeyBindings;
|
|
4086
4113
|
};
|
|
4087
4114
|
const getFallthroughKeyBindings = () => {
|
|
4088
|
-
return state$
|
|
4115
|
+
return state$3.fallThroughKeyBindings;
|
|
4089
4116
|
};
|
|
4090
4117
|
const setCanceled = id => {
|
|
4091
|
-
state$
|
|
4118
|
+
state$3.canceled[id] = true;
|
|
4092
4119
|
};
|
|
4093
4120
|
|
|
4094
4121
|
const shouldAllowNavigation = webContentsId => {
|
|
@@ -4418,20 +4445,20 @@ const createElectronSession = () => {
|
|
|
4418
4445
|
return session;
|
|
4419
4446
|
};
|
|
4420
4447
|
|
|
4421
|
-
const state$
|
|
4448
|
+
const state$2 = {
|
|
4422
4449
|
session: undefined
|
|
4423
4450
|
};
|
|
4424
4451
|
const has = () => {
|
|
4425
|
-
return Boolean(state$
|
|
4452
|
+
return Boolean(state$2.session);
|
|
4426
4453
|
};
|
|
4427
4454
|
const get$2 = () => {
|
|
4428
|
-
if (!state$
|
|
4455
|
+
if (!state$2.session) {
|
|
4429
4456
|
throw new Error('session is not defined');
|
|
4430
4457
|
}
|
|
4431
|
-
return state$
|
|
4458
|
+
return state$2.session;
|
|
4432
4459
|
};
|
|
4433
4460
|
const set$1 = value => {
|
|
4434
|
-
state$
|
|
4461
|
+
state$2.session = value;
|
|
4435
4462
|
};
|
|
4436
4463
|
|
|
4437
4464
|
const create$2 = rpc => {
|
|
@@ -4474,6 +4501,28 @@ class WindowLoadError extends VError {
|
|
|
4474
4501
|
}
|
|
4475
4502
|
}
|
|
4476
4503
|
|
|
4504
|
+
const state$1 = {
|
|
4505
|
+
console: undefined
|
|
4506
|
+
};
|
|
4507
|
+
const getOrCreateLogger = () => {
|
|
4508
|
+
state$1.console ||= createFileLogger('log-window.txt');
|
|
4509
|
+
return state$1.console;
|
|
4510
|
+
};
|
|
4511
|
+
const formatMessage = ({
|
|
4512
|
+
level,
|
|
4513
|
+
lineNumber,
|
|
4514
|
+
message,
|
|
4515
|
+
sourceId
|
|
4516
|
+
}) => {
|
|
4517
|
+
const source = sourceId ? ` (${sourceId}:${lineNumber})` : '';
|
|
4518
|
+
return `${new Date().toISOString()} [${level}] [Window] ${message}${source}`;
|
|
4519
|
+
};
|
|
4520
|
+
const addListener = (webContents, logger = getOrCreateLogger()) => {
|
|
4521
|
+
webContents.on('console-message', event => {
|
|
4522
|
+
logger.log(formatMessage(event));
|
|
4523
|
+
});
|
|
4524
|
+
};
|
|
4525
|
+
|
|
4477
4526
|
// TODO impossible to test these methods
|
|
4478
4527
|
// and ensure that there is no memory leak
|
|
4479
4528
|
|
|
@@ -4494,9 +4543,6 @@ const addDevDiagnostics = window => {
|
|
|
4494
4543
|
if (!process.env.DEV) {
|
|
4495
4544
|
return;
|
|
4496
4545
|
}
|
|
4497
|
-
window.webContents.on('console-message', (_event, level, message, line, sourceId) => {
|
|
4498
|
-
info(`[app window console] level=${level} source=${sourceId}:${line} message=${message}`);
|
|
4499
|
-
});
|
|
4500
4546
|
window.webContents.on('did-fail-load', (_event, errorCode, errorDescription, validatedUrl, isMainFrame) => {
|
|
4501
4547
|
error(`[app window did-fail-load] code=${errorCode} mainFrame=${isMainFrame} url=${validatedUrl} error=${errorDescription}`);
|
|
4502
4548
|
});
|
|
@@ -4520,6 +4566,7 @@ const createAppWindow = async (windowOptions, parsedArgs, workingDirectory, titl
|
|
|
4520
4566
|
}
|
|
4521
4567
|
});
|
|
4522
4568
|
mark(DidCreateCodeWindow);
|
|
4569
|
+
addListener(window.webContents);
|
|
4523
4570
|
addDevDiagnostics(window);
|
|
4524
4571
|
const handleReadyToShow = () => {
|
|
4525
4572
|
// due to electron bug, zoom level needs to be set here,
|