浏览代码

Enable the Chromium sandbox

Manav Rathi 1 年之前
父节点
当前提交
cfec6ca52e
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      desktop/src/main.ts

+ 2 - 2
desktop/src/main.ts

@@ -100,12 +100,11 @@ const logStartupBanner = () => {
  * will respect in verbatim, it uses its own heuristics atop this hint.
  * will respect in verbatim, it uses its own heuristics atop this hint.
  * https://superuser.com/questions/378991/what-is-chrome-default-cache-size-limit/1577693#1577693
  * https://superuser.com/questions/378991/what-is-chrome-default-cache-size-limit/1577693#1577693
  */
  */
-const increaseDiskCache = () => {
+const increaseDiskCache = () =>
     app.commandLine.appendSwitch(
     app.commandLine.appendSwitch(
         "disk-cache-size",
         "disk-cache-size",
         `${5 * 1024 * 1024 * 1024}`, // 5 GB
         `${5 * 1024 * 1024 * 1024}`, // 5 GB
     );
     );
-};
 
 
 /**
 /**
  * Create an return the {@link BrowserWindow} that will form our app's UI.
  * Create an return the {@link BrowserWindow} that will form our app's UI.
@@ -117,6 +116,7 @@ const createMainWindow = async () => {
     const window = new BrowserWindow({
     const window = new BrowserWindow({
         webPreferences: {
         webPreferences: {
             preload: path.join(app.getAppPath(), "preload.js"),
             preload: path.join(app.getAppPath(), "preload.js"),
+            sandbox: true,
         },
         },
         // The color to show in the window until the web content gets loaded.
         // The color to show in the window until the web content gets loaded.
         // See: https://www.electronjs.org/docs/latest/api/browser-window#setting-the-backgroundcolor-property
         // See: https://www.electronjs.org/docs/latest/api/browser-window#setting-the-backgroundcolor-property