@lvce-editor/main-process 6.37.3 → 6.37.5
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 +137 -98
- package/package.json +1 -1
package/dist/mainProcessMain.js
CHANGED
|
@@ -2825,7 +2825,7 @@ const execute$1 = (command, ...args) => {
|
|
|
2825
2825
|
|
|
2826
2826
|
const Two$2 = '2.0';
|
|
2827
2827
|
const callbacks = Object.create(null);
|
|
2828
|
-
const set$
|
|
2828
|
+
const set$3 = (id, fn) => {
|
|
2829
2829
|
callbacks[id] = fn;
|
|
2830
2830
|
};
|
|
2831
2831
|
const get$5 = id => {
|
|
@@ -2846,7 +2846,7 @@ const registerPromise$1 = () => {
|
|
|
2846
2846
|
promise,
|
|
2847
2847
|
resolve
|
|
2848
2848
|
} = Promise.withResolvers();
|
|
2849
|
-
set$
|
|
2849
|
+
set$3(id, resolve);
|
|
2850
2850
|
return {
|
|
2851
2851
|
id,
|
|
2852
2852
|
promise
|
|
@@ -4909,7 +4909,7 @@ const createElectronSession = () => {
|
|
|
4909
4909
|
const state$1 = {
|
|
4910
4910
|
session: undefined
|
|
4911
4911
|
};
|
|
4912
|
-
const has = () => {
|
|
4912
|
+
const has$1 = () => {
|
|
4913
4913
|
return Boolean(state$1.session);
|
|
4914
4914
|
};
|
|
4915
4915
|
const get$3 = () => {
|
|
@@ -4918,7 +4918,7 @@ const get$3 = () => {
|
|
|
4918
4918
|
}
|
|
4919
4919
|
return state$1.session;
|
|
4920
4920
|
};
|
|
4921
|
-
const set$
|
|
4921
|
+
const set$2 = value => {
|
|
4922
4922
|
state$1.session = value;
|
|
4923
4923
|
};
|
|
4924
4924
|
|
|
@@ -4938,8 +4938,8 @@ const create$2 = rpc => {
|
|
|
4938
4938
|
};
|
|
4939
4939
|
|
|
4940
4940
|
const get$2 = () => {
|
|
4941
|
-
if (!has()) {
|
|
4942
|
-
set$
|
|
4941
|
+
if (!has$1()) {
|
|
4942
|
+
set$2(createElectronSession());
|
|
4943
4943
|
}
|
|
4944
4944
|
return get$3();
|
|
4945
4945
|
};
|
|
@@ -5222,7 +5222,7 @@ const createPidMap = () => {
|
|
|
5222
5222
|
};
|
|
5223
5223
|
|
|
5224
5224
|
const rpcs = Object.create(null);
|
|
5225
|
-
const set = (id, rpc) => {
|
|
5225
|
+
const set$1 = (id, rpc) => {
|
|
5226
5226
|
rpcs[id] = rpc;
|
|
5227
5227
|
};
|
|
5228
5228
|
const get$1 = id => {
|
|
@@ -5235,7 +5235,7 @@ const createUtilityProcessRpc = async options => {
|
|
|
5235
5235
|
...options
|
|
5236
5236
|
});
|
|
5237
5237
|
const rpcId = options.targetRpcId || options.rpcId || options.ipcId;
|
|
5238
|
-
set(rpcId, rpc);
|
|
5238
|
+
set$1(rpcId, rpc);
|
|
5239
5239
|
};
|
|
5240
5240
|
|
|
5241
5241
|
const serializeDeskopCapturerSource = source => {
|
|
@@ -6372,100 +6372,21 @@ const ElectronBrowserViewEventListenerDestroyed = {
|
|
|
6372
6372
|
key: key$6
|
|
6373
6373
|
};
|
|
6374
6374
|
|
|
6375
|
-
const
|
|
6376
|
-
const
|
|
6377
|
-
|
|
6378
|
-
};
|
|
6379
|
-
const detach$5 = (webContents, listener) => {
|
|
6380
|
-
webContents.off(DidNavigate, listener);
|
|
6381
|
-
};
|
|
6382
|
-
const handler$5 = (event, url) => {
|
|
6383
|
-
return {
|
|
6384
|
-
messages: [['handleDidNavigate', url]],
|
|
6385
|
-
result: undefined
|
|
6386
|
-
};
|
|
6387
|
-
};
|
|
6388
|
-
|
|
6389
|
-
const ElectronBrowserViewEventListenerDidNavigate = {
|
|
6390
|
-
__proto__: null,
|
|
6391
|
-
attach: attach$7,
|
|
6392
|
-
detach: detach$5,
|
|
6393
|
-
handler: handler$5,
|
|
6394
|
-
key: key$5
|
|
6395
|
-
};
|
|
6396
|
-
|
|
6397
|
-
const pendingLogins = new Map();
|
|
6398
|
-
let nextRequestId = 1;
|
|
6399
|
-
const add = (webContentsId, callback) => {
|
|
6400
|
-
const requestId = `${webContentsId}:${nextRequestId++}`;
|
|
6401
|
-
pendingLogins.set(requestId, {
|
|
6402
|
-
callback,
|
|
6403
|
-
webContentsId
|
|
6404
|
-
});
|
|
6405
|
-
return requestId;
|
|
6406
|
-
};
|
|
6407
|
-
const take = requestId => {
|
|
6408
|
-
const pendingLogin = pendingLogins.get(requestId);
|
|
6409
|
-
pendingLogins.delete(requestId);
|
|
6410
|
-
return pendingLogin;
|
|
6411
|
-
};
|
|
6412
|
-
const accept = (requestId, username, password) => {
|
|
6413
|
-
const pendingLogin = take(requestId);
|
|
6414
|
-
pendingLogin?.callback(username, password);
|
|
6415
|
-
};
|
|
6416
|
-
const cancel = requestId => {
|
|
6417
|
-
const pendingLogin = take(requestId);
|
|
6418
|
-
pendingLogin?.callback();
|
|
6419
|
-
};
|
|
6420
|
-
const cancelForWebContents = webContentsId => {
|
|
6421
|
-
for (const [requestId, pendingLogin] of pendingLogins) {
|
|
6422
|
-
if (pendingLogin.webContentsId !== webContentsId) {
|
|
6423
|
-
continue;
|
|
6424
|
-
}
|
|
6425
|
-
pendingLogins.delete(requestId);
|
|
6426
|
-
pendingLogin.callback();
|
|
6427
|
-
}
|
|
6428
|
-
};
|
|
6429
|
-
|
|
6430
|
-
const key$4 = Login;
|
|
6431
|
-
const attach$6 = (webContents, listener) => {
|
|
6432
|
-
webContents.on(Login, listener);
|
|
6375
|
+
const faviconUrls = new WeakMap();
|
|
6376
|
+
const set = (webContents, url) => {
|
|
6377
|
+
faviconUrls.set(webContents, url);
|
|
6433
6378
|
};
|
|
6434
|
-
const
|
|
6435
|
-
|
|
6436
|
-
};
|
|
6437
|
-
const handler$4 = (event, authenticationResponseDetails, authInfo, callback, webContentsId) => {
|
|
6438
|
-
event.preventDefault();
|
|
6439
|
-
const requestId = add(webContentsId, callback);
|
|
6440
|
-
return {
|
|
6441
|
-
messages: [['handleLogin', {
|
|
6442
|
-
host: authInfo.host,
|
|
6443
|
-
isProxy: authInfo.isProxy,
|
|
6444
|
-
port: authInfo.port,
|
|
6445
|
-
realm: authInfo.realm,
|
|
6446
|
-
requestId,
|
|
6447
|
-
scheme: authInfo.scheme,
|
|
6448
|
-
url: String(authenticationResponseDetails.url)
|
|
6449
|
-
}]],
|
|
6450
|
-
result: undefined
|
|
6451
|
-
};
|
|
6452
|
-
};
|
|
6453
|
-
|
|
6454
|
-
const ElectronBrowserViewEventListenerLogin = {
|
|
6455
|
-
__proto__: null,
|
|
6456
|
-
attach: attach$6,
|
|
6457
|
-
detach: detach$4,
|
|
6458
|
-
handler: handler$4,
|
|
6459
|
-
key: key$4
|
|
6379
|
+
const has = (webContents, url) => {
|
|
6380
|
+
return faviconUrls.get(webContents) === url;
|
|
6460
6381
|
};
|
|
6461
6382
|
|
|
6462
6383
|
const maxFaviconBytes = 1024 * 1024;
|
|
6463
6384
|
const faviconFetchTimeout = 2000;
|
|
6464
|
-
const key$
|
|
6465
|
-
const attach$
|
|
6385
|
+
const key$5 = PageFaviconUpdated;
|
|
6386
|
+
const attach$7 = (webContents, listener) => {
|
|
6466
6387
|
webContents.on(PageFaviconUpdated, listener);
|
|
6467
6388
|
};
|
|
6468
|
-
const detach$
|
|
6389
|
+
const detach$5 = (webContents, listener) => {
|
|
6469
6390
|
webContents.off(PageFaviconUpdated, listener);
|
|
6470
6391
|
};
|
|
6471
6392
|
const getFaviconDataUrl = async (fetcher, favicon, signal) => {
|
|
@@ -6527,11 +6448,22 @@ const resolveFavicon = async (event, favicons) => {
|
|
|
6527
6448
|
if (sessionFavicon) {
|
|
6528
6449
|
return [sessionFavicon];
|
|
6529
6450
|
}
|
|
6451
|
+
const networkFavicons = await resolveNetworkFavicon(favicons);
|
|
6452
|
+
return networkFavicons.length > 0 ? networkFavicons : favicons;
|
|
6453
|
+
};
|
|
6454
|
+
const resolveNetworkFavicon = async favicons => {
|
|
6455
|
+
const dataUrl = favicons.find(favicon => favicon.startsWith('data:'));
|
|
6456
|
+
if (dataUrl) {
|
|
6457
|
+
return [dataUrl];
|
|
6458
|
+
}
|
|
6530
6459
|
const networkFavicon = await resolveWithTimeout((url, options) => fetch(url, options), favicons);
|
|
6531
|
-
return networkFavicon ? [networkFavicon] :
|
|
6460
|
+
return networkFavicon ? [networkFavicon] : [];
|
|
6532
6461
|
};
|
|
6533
|
-
const handler$
|
|
6462
|
+
const handler$5 = async (event, favicons) => {
|
|
6534
6463
|
const pageUrl = event.sender.getURL();
|
|
6464
|
+
if (favicons.length > 0) {
|
|
6465
|
+
set(event.sender, pageUrl);
|
|
6466
|
+
}
|
|
6535
6467
|
const resolvedFavicons = await resolveFavicon(event, favicons);
|
|
6536
6468
|
return {
|
|
6537
6469
|
messages: event.sender.getURL() === pageUrl ? [['handlePageFaviconUpdated', resolvedFavicons]] : [],
|
|
@@ -6540,6 +6472,113 @@ const handler$3 = async (event, favicons) => {
|
|
|
6540
6472
|
};
|
|
6541
6473
|
|
|
6542
6474
|
const ElectronBrowserViewEventListenerPageFaviconUpdated = {
|
|
6475
|
+
__proto__: null,
|
|
6476
|
+
attach: attach$7,
|
|
6477
|
+
detach: detach$5,
|
|
6478
|
+
handler: handler$5,
|
|
6479
|
+
key: key$5,
|
|
6480
|
+
resolveNetworkFavicon
|
|
6481
|
+
};
|
|
6482
|
+
|
|
6483
|
+
const key$4 = 'did-navigate';
|
|
6484
|
+
const attach$6 = (webContents, listener) => {
|
|
6485
|
+
webContents.on(DidNavigate, listener);
|
|
6486
|
+
};
|
|
6487
|
+
const detach$4 = (webContents, listener) => {
|
|
6488
|
+
webContents.off(DidNavigate, listener);
|
|
6489
|
+
};
|
|
6490
|
+
const loadDefaultFavicon = async (event, url) => {
|
|
6491
|
+
let faviconUrl;
|
|
6492
|
+
try {
|
|
6493
|
+
const parsedUrl = new URL(url);
|
|
6494
|
+
if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') {
|
|
6495
|
+
return [];
|
|
6496
|
+
}
|
|
6497
|
+
faviconUrl = new URL('/favicon.ico', parsedUrl).href;
|
|
6498
|
+
} catch {
|
|
6499
|
+
return [];
|
|
6500
|
+
}
|
|
6501
|
+
const favicons = await resolveNetworkFavicon([faviconUrl]);
|
|
6502
|
+
if (favicons.length === 0 || event.sender.getURL() !== url || has(event.sender, url)) {
|
|
6503
|
+
return [];
|
|
6504
|
+
}
|
|
6505
|
+
return favicons;
|
|
6506
|
+
};
|
|
6507
|
+
const handler$4 = async (event, url, _httpResponseCode, _httpStatusText, _webContentsId) => {
|
|
6508
|
+
const favicons = await loadDefaultFavicon(event, url);
|
|
6509
|
+
const messages = favicons.length > 0 ? [['handleDidNavigate', url], ['handlePageFaviconUpdated', favicons]] : [['handleDidNavigate', url]];
|
|
6510
|
+
return {
|
|
6511
|
+
messages,
|
|
6512
|
+
result: undefined
|
|
6513
|
+
};
|
|
6514
|
+
};
|
|
6515
|
+
|
|
6516
|
+
const ElectronBrowserViewEventListenerDidNavigate = {
|
|
6517
|
+
__proto__: null,
|
|
6518
|
+
attach: attach$6,
|
|
6519
|
+
detach: detach$4,
|
|
6520
|
+
handler: handler$4,
|
|
6521
|
+
key: key$4
|
|
6522
|
+
};
|
|
6523
|
+
|
|
6524
|
+
const pendingLogins = new Map();
|
|
6525
|
+
let nextRequestId = 1;
|
|
6526
|
+
const add = (webContentsId, callback) => {
|
|
6527
|
+
const requestId = `${webContentsId}:${nextRequestId++}`;
|
|
6528
|
+
pendingLogins.set(requestId, {
|
|
6529
|
+
callback,
|
|
6530
|
+
webContentsId
|
|
6531
|
+
});
|
|
6532
|
+
return requestId;
|
|
6533
|
+
};
|
|
6534
|
+
const take = requestId => {
|
|
6535
|
+
const pendingLogin = pendingLogins.get(requestId);
|
|
6536
|
+
pendingLogins.delete(requestId);
|
|
6537
|
+
return pendingLogin;
|
|
6538
|
+
};
|
|
6539
|
+
const accept = (requestId, username, password) => {
|
|
6540
|
+
const pendingLogin = take(requestId);
|
|
6541
|
+
pendingLogin?.callback(username, password);
|
|
6542
|
+
};
|
|
6543
|
+
const cancel = requestId => {
|
|
6544
|
+
const pendingLogin = take(requestId);
|
|
6545
|
+
pendingLogin?.callback();
|
|
6546
|
+
};
|
|
6547
|
+
const cancelForWebContents = webContentsId => {
|
|
6548
|
+
for (const [requestId, pendingLogin] of pendingLogins) {
|
|
6549
|
+
if (pendingLogin.webContentsId !== webContentsId) {
|
|
6550
|
+
continue;
|
|
6551
|
+
}
|
|
6552
|
+
pendingLogins.delete(requestId);
|
|
6553
|
+
pendingLogin.callback();
|
|
6554
|
+
}
|
|
6555
|
+
};
|
|
6556
|
+
|
|
6557
|
+
const key$3 = Login;
|
|
6558
|
+
const attach$5 = (webContents, listener) => {
|
|
6559
|
+
webContents.on(Login, listener);
|
|
6560
|
+
};
|
|
6561
|
+
const detach$3 = (webContents, listener) => {
|
|
6562
|
+
webContents.off(Login, listener);
|
|
6563
|
+
};
|
|
6564
|
+
const handler$3 = (event, authenticationResponseDetails, authInfo, callback, webContentsId) => {
|
|
6565
|
+
event.preventDefault();
|
|
6566
|
+
const requestId = add(webContentsId, callback);
|
|
6567
|
+
return {
|
|
6568
|
+
messages: [['handleLogin', {
|
|
6569
|
+
host: authInfo.host,
|
|
6570
|
+
isProxy: authInfo.isProxy,
|
|
6571
|
+
port: authInfo.port,
|
|
6572
|
+
realm: authInfo.realm,
|
|
6573
|
+
requestId,
|
|
6574
|
+
scheme: authInfo.scheme,
|
|
6575
|
+
url: String(authenticationResponseDetails.url)
|
|
6576
|
+
}]],
|
|
6577
|
+
result: undefined
|
|
6578
|
+
};
|
|
6579
|
+
};
|
|
6580
|
+
|
|
6581
|
+
const ElectronBrowserViewEventListenerLogin = {
|
|
6543
6582
|
__proto__: null,
|
|
6544
6583
|
attach: attach$5,
|
|
6545
6584
|
detach: detach$3,
|
|
@@ -7396,7 +7435,7 @@ const handleElectronMessagePort = async (messagePort, rpcId) => {
|
|
|
7396
7435
|
requiresSocket: requiresSocket
|
|
7397
7436
|
});
|
|
7398
7437
|
if (rpcId) {
|
|
7399
|
-
set(rpcId, rpc);
|
|
7438
|
+
set$1(rpcId, rpc);
|
|
7400
7439
|
}
|
|
7401
7440
|
};
|
|
7402
7441
|
|