@lvce-editor/main-process 6.37.9 → 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.
@@ -7293,7 +7293,7 @@ const setFallThroughKeyBindings = (_view, fallthroughKeyBindings) => {
7293
7293
  /**
7294
7294
  * @param {Electron.BrowserView} view
7295
7295
  */
7296
- const getStats = view => {
7296
+ const getStats = (view, includeMemory = false) => {
7297
7297
  const {
7298
7298
  webContents
7299
7299
  } = view;
@@ -7302,13 +7302,22 @@ const getStats = view => {
7302
7302
  const isAudioMuted = webContents.isAudioMuted();
7303
7303
  const url = webContents.getURL();
7304
7304
  const title = webContents.getTitle();
7305
- return {
7305
+ const stats = {
7306
7306
  canGoBack,
7307
7307
  canGoForward,
7308
7308
  isAudioMuted,
7309
7309
  title,
7310
7310
  url
7311
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
+ };
7312
7321
  };
7313
7322
 
7314
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.9",
3
+ "version": "6.37.10",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "electron"