Commit 2bf0eab
committed
feat(electron): detect Snap/AppImage and adjust sandboxing
Detect Snap and AppImage environments at startup and adjust the
renderer sandbox and GPU sandbox accordingly. Add env checks in
main.ts and app.ts to determine if process.env.SNAP or
process.env.APPIMAGE is set. When running inside Snap or AppImage,
append the disable-gpu-sandbox command line switch and disable the
renderer sandbox for BrowserWindow by setting sandbox: false.
This prevents conflicts between Electron's sandboxing/GPU sandbox
and confinement used by Snap/AppImage packages, improving stability
for packaged Linux builds.1 parent 54c61df commit 2bf0eab
2 files changed
+17
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| |||
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
78 | 85 | | |
79 | 86 | | |
80 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
17 | 27 | | |
18 | 28 | | |
19 | 29 | | |
| |||
0 commit comments