@lvce-editor/main-process 6.37.8 → 6.37.10

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.
@@ -4082,6 +4082,7 @@ const ContextMenu = 'context-menu';
4082
4082
  const WillNavigate = 'will-navigate';
4083
4083
  const DidStartNavigation = 'did-start-navigation';
4084
4084
  const DidNavigate = 'did-navigate';
4085
+ const DidNavigateInPage = 'did-navigate-in-page';
4085
4086
  const PageTitleUpdated = 'page-title-updated';
4086
4087
  const PageFaviconUpdated = 'page-favicon-updated';
4087
4088
  const Destroyed = 'destroyed';
@@ -6260,14 +6261,14 @@ const handleWebContentsViewZoomKeyBinding = (webContentsId, input) => {
6260
6261
  return true;
6261
6262
  };
6262
6263
 
6263
- const key$9 = 'before-input';
6264
- const attach$b = (webContents, listener) => {
6264
+ const key$a = 'before-input';
6265
+ const attach$c = (webContents, listener) => {
6265
6266
  webContents.on(BeforeInputEvent, listener);
6266
6267
  };
6267
- const detach$9 = (webContents, listener) => {
6268
+ const detach$a = (webContents, listener) => {
6268
6269
  webContents.off(BeforeInputEvent, listener);
6269
6270
  };
6270
- const handler$9 = (event, input, webContentsId) => {
6271
+ const handler$a = (event, input, webContentsId) => {
6271
6272
  if (input.type !== KeyDown) {
6272
6273
  return {
6273
6274
  messages: [],
@@ -6301,20 +6302,20 @@ const handler$9 = (event, input, webContentsId) => {
6301
6302
 
6302
6303
  const ElectronBrowserViewEventListenerBeforeInput = {
6303
6304
  __proto__: null,
6304
- attach: attach$b,
6305
- detach: detach$9,
6306
- handler: handler$9,
6307
- key: key$9
6305
+ attach: attach$c,
6306
+ detach: detach$a,
6307
+ handler: handler$a,
6308
+ key: key$a
6308
6309
  };
6309
6310
 
6310
- const key$8 = AudioStateChanged;
6311
- const attach$a = (webContents, listener) => {
6311
+ const key$9 = AudioStateChanged;
6312
+ const attach$b = (webContents, listener) => {
6312
6313
  webContents.on(AudioStateChanged, listener);
6313
6314
  };
6314
- const detach$8 = (webContents, listener) => {
6315
+ const detach$9 = (webContents, listener) => {
6315
6316
  webContents.off(AudioStateChanged, listener);
6316
6317
  };
6317
- const handler$8 = event => {
6318
+ const handler$9 = event => {
6318
6319
  return {
6319
6320
  messages: [['handleAudioStateChanged', event.audible]],
6320
6321
  result: undefined
@@ -6323,20 +6324,20 @@ const handler$8 = event => {
6323
6324
 
6324
6325
  const ElectronBrowserViewEventListenerAudioStateChanged = {
6325
6326
  __proto__: null,
6326
- attach: attach$a,
6327
- detach: detach$8,
6328
- handler: handler$8,
6329
- key: key$8
6327
+ attach: attach$b,
6328
+ detach: detach$9,
6329
+ handler: handler$9,
6330
+ key: key$9
6330
6331
  };
6331
6332
 
6332
- const key$7 = 'context-menu';
6333
- const attach$9 = (webContents, listener) => {
6333
+ const key$8 = 'context-menu';
6334
+ const attach$a = (webContents, listener) => {
6334
6335
  webContents.on(ContextMenu, listener);
6335
6336
  };
6336
- const detach$7 = (webContents, listener) => {
6337
+ const detach$8 = (webContents, listener) => {
6337
6338
  webContents.off(ContextMenu, listener);
6338
6339
  };
6339
- const handler$7 = (event, params) => {
6340
+ const handler$8 = (event, params) => {
6340
6341
  return {
6341
6342
  messages: [['handleContextMenu', params]],
6342
6343
  result: undefined
@@ -6345,20 +6346,20 @@ const handler$7 = (event, params) => {
6345
6346
 
6346
6347
  const ElectronBrowserViewEventListenerContextMenu = {
6347
6348
  __proto__: null,
6348
- attach: attach$9,
6349
- detach: detach$7,
6350
- handler: handler$7,
6351
- key: key$7
6349
+ attach: attach$a,
6350
+ detach: detach$8,
6351
+ handler: handler$8,
6352
+ key: key$8
6352
6353
  };
6353
6354
 
6354
- const key$6 = 'destroyed';
6355
- const attach$8 = (webContents, listener) => {
6355
+ const key$7 = 'destroyed';
6356
+ const attach$9 = (webContents, listener) => {
6356
6357
  webContents.on(Destroyed, listener);
6357
6358
  };
6358
- const detach$6 = (webContents, listener) => {
6359
+ const detach$7 = (webContents, listener) => {
6359
6360
  webContents.off(Destroyed, listener);
6360
6361
  };
6361
- const handler$6 = () => {
6362
+ const handler$7 = () => {
6362
6363
  return {
6363
6364
  messages: [['handleBrowserViewDestroyed']],
6364
6365
  result: undefined
@@ -6367,10 +6368,10 @@ const handler$6 = () => {
6367
6368
 
6368
6369
  const ElectronBrowserViewEventListenerDestroyed = {
6369
6370
  __proto__: null,
6370
- attach: attach$8,
6371
- detach: detach$6,
6372
- handler: handler$6,
6373
- key: key$6
6371
+ attach: attach$9,
6372
+ detach: detach$7,
6373
+ handler: handler$7,
6374
+ key: key$7
6374
6375
  };
6375
6376
 
6376
6377
  const faviconUrls = new WeakMap();
@@ -6383,11 +6384,11 @@ const has = (webContents, url) => {
6383
6384
 
6384
6385
  const maxFaviconBytes = 1024 * 1024;
6385
6386
  const faviconFetchTimeout = 2000;
6386
- const key$5 = PageFaviconUpdated;
6387
- const attach$7 = (webContents, listener) => {
6387
+ const key$6 = PageFaviconUpdated;
6388
+ const attach$8 = (webContents, listener) => {
6388
6389
  webContents.on(PageFaviconUpdated, listener);
6389
6390
  };
6390
- const detach$5 = (webContents, listener) => {
6391
+ const detach$6 = (webContents, listener) => {
6391
6392
  webContents.off(PageFaviconUpdated, listener);
6392
6393
  };
6393
6394
  const getFaviconDataUrl = async (fetcher, favicon, signal) => {
@@ -6460,7 +6461,7 @@ const resolveNetworkFavicon = async favicons => {
6460
6461
  const networkFavicon = await resolveWithTimeout((url, options) => fetch(url, options), favicons);
6461
6462
  return networkFavicon ? [networkFavicon] : [];
6462
6463
  };
6463
- const handler$5 = async (_event, favicons, _webContentsId, webContents) => {
6464
+ const handler$6 = async (_event, favicons, _webContentsId, webContents) => {
6464
6465
  const pageUrl = webContents.getURL();
6465
6466
  if (favicons.length > 0) {
6466
6467
  set(webContents, pageUrl);
@@ -6474,18 +6475,18 @@ const handler$5 = async (_event, favicons, _webContentsId, webContents) => {
6474
6475
 
6475
6476
  const ElectronBrowserViewEventListenerPageFaviconUpdated = {
6476
6477
  __proto__: null,
6477
- attach: attach$7,
6478
- detach: detach$5,
6479
- handler: handler$5,
6480
- key: key$5,
6478
+ attach: attach$8,
6479
+ detach: detach$6,
6480
+ handler: handler$6,
6481
+ key: key$6,
6481
6482
  resolveNetworkFavicon
6482
6483
  };
6483
6484
 
6484
- const key$4 = 'did-navigate';
6485
- const attach$6 = (webContents, listener) => {
6485
+ const key$5 = 'did-navigate';
6486
+ const attach$7 = (webContents, listener) => {
6486
6487
  webContents.on(DidNavigate, listener);
6487
6488
  };
6488
- const detach$4 = (webContents, listener) => {
6489
+ const detach$5 = (webContents, listener) => {
6489
6490
  webContents.off(DidNavigate, listener);
6490
6491
  };
6491
6492
  const loadDefaultFavicon = async (webContents, url) => {
@@ -6508,7 +6509,7 @@ const loadDefaultFavicon = async (webContents, url) => {
6508
6509
  }
6509
6510
  return favicons;
6510
6511
  };
6511
- const handler$4 = async (_event, url, _httpResponseCode, _httpStatusText, _webContentsId, webContents) => {
6512
+ const handler$5 = async (_event, url, _httpResponseCode, _httpStatusText, _webContentsId, webContents) => {
6512
6513
  const favicons = await loadDefaultFavicon(webContents, url);
6513
6514
  const messages = favicons.length > 0 ? [['handleDidNavigate', url], ['handlePageFaviconUpdated', favicons]] : [['handleDidNavigate', url]];
6514
6515
  return {
@@ -6518,6 +6519,29 @@ const handler$4 = async (_event, url, _httpResponseCode, _httpStatusText, _webCo
6518
6519
  };
6519
6520
 
6520
6521
  const ElectronBrowserViewEventListenerDidNavigate = {
6522
+ __proto__: null,
6523
+ attach: attach$7,
6524
+ detach: detach$5,
6525
+ handler: handler$5,
6526
+ key: key$5
6527
+ };
6528
+
6529
+ const key$4 = DidNavigateInPage;
6530
+ const attach$6 = (webContents, listener) => {
6531
+ webContents.on(DidNavigateInPage, listener);
6532
+ };
6533
+ const detach$4 = (webContents, listener) => {
6534
+ webContents.off(DidNavigateInPage, listener);
6535
+ };
6536
+ const handler$4 = (_event, url, isMainFrame) => {
6537
+ const messages = isMainFrame ? [['handleDidNavigate', url]] : [];
6538
+ return {
6539
+ messages,
6540
+ result: undefined
6541
+ };
6542
+ };
6543
+
6544
+ const ElectronBrowserViewEventListenerDidNavigateInPage = {
6521
6545
  __proto__: null,
6522
6546
  attach: attach$6,
6523
6547
  detach: detach$4,
@@ -6669,6 +6693,7 @@ const ElectronBrowserViewEventListeners = {
6669
6693
  contextMenu: ElectronBrowserViewEventListenerContextMenu,
6670
6694
  destroyed: ElectronBrowserViewEventListenerDestroyed,
6671
6695
  didNavigate: ElectronBrowserViewEventListenerDidNavigate,
6696
+ didNavigateInPage: ElectronBrowserViewEventListenerDidNavigateInPage,
6672
6697
  login: ElectronBrowserViewEventListenerLogin,
6673
6698
  pageFaviconUpdated: ElectronBrowserViewEventListenerPageFaviconUpdated,
6674
6699
  pageTitleUpdated: ElectronBrowserViewEventListenerPageTitleUpdated,
@@ -7268,7 +7293,7 @@ const setFallThroughKeyBindings = (_view, fallthroughKeyBindings) => {
7268
7293
  /**
7269
7294
  * @param {Electron.BrowserView} view
7270
7295
  */
7271
- const getStats = view => {
7296
+ const getStats = (view, includeMemory = false) => {
7272
7297
  const {
7273
7298
  webContents
7274
7299
  } = view;
@@ -7277,13 +7302,22 @@ const getStats = view => {
7277
7302
  const isAudioMuted = webContents.isAudioMuted();
7278
7303
  const url = webContents.getURL();
7279
7304
  const title = webContents.getTitle();
7280
- return {
7305
+ const stats = {
7281
7306
  canGoBack,
7282
7307
  canGoForward,
7283
7308
  isAudioMuted,
7284
7309
  title,
7285
7310
  url
7286
7311
  };
7312
+ if (!includeMemory) {
7313
+ return stats;
7314
+ }
7315
+ const processId = webContents.getOSProcessId();
7316
+ const processMetric = app.getAppMetrics().find(metric => metric.pid === processId);
7317
+ return {
7318
+ ...stats,
7319
+ memory: (processMetric?.memory.workingSetSize || 0) * 1024
7320
+ };
7287
7321
  };
7288
7322
 
7289
7323
  const gpuInfoUrl = 'chrome://gpu';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-process",
3
- "version": "6.37.8",
3
+ "version": "6.37.10",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "electron"