fix: allow preload to expose electronAPI#9
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes application startup issues on Windows by enabling sandbox mode in Electron's webPreferences. The change addresses problems with npm run dev and releases v1.5.1/v1.5.2 failing to launch on Windows.
Changes:
- Changed
sandboxsetting fromfalsetotruein Electron's webPreferences configuration
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -81,7 +81,7 @@ function createWindow() { | |||
| nodeIntegration: false, | |||
| contextIsolation: true, | |||
| // Enable sandbox for better security on Mac | |||
There was a problem hiding this comment.
The comment is misleading and should be updated. It states "Enable sandbox for better security on Mac" but the sandbox setting applies to all platforms, not just Mac. Consider updating the comment to reflect that this is a general security setting, such as "Enable sandbox for better security" or "Sandbox enabled for improved security isolation".
| // Enable sandbox for better security on Mac | |
| // Enable sandbox for improved security isolation |
|
也可以在index注入热更新 |
尝试修复 Windows 中
npm run dev无法启动以及 v1.5.1 / v1.5.2 无法启动的问题请验证是否有效