Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
vivekvardha opened this issue · comments
vivjil commented
I am facing the error in title when I try to run the app with sudo privileges.
I created the new window as follows.
var w *astilectron.Window
if w, err = a.NewWindow("sample/logs.html", &astilectron.WindowOptions{
Center: astikit.BoolPtr(true),
Height: astikit.IntPtr(700),
Width: astikit.IntPtr(700),
MinWidth: astikit.IntPtr(100),
**WebPreferences: &astilectron.WebPreferences{Sandbox: astikit.BoolPtr(false)}**,
}); err != nil {
log.Println(fmt.Sprintf("main: new window failed: %w", err))
}
By initializing Sandbox under WebPreferences to 'false', I thought it would solve the problem but it did not work.
Any leads to fix/workaround this would be of great help.
Quentin Renard commented
You could try using ElectronSwitches. Basically they are flags you can provide to Electron.
In your case you could try setting it to []string{"--no-sandbox"}
Quentin Renard commented
Cheers