diff --git a/chromium_process/ChromiumApp.cpp b/chromium_process/ChromiumApp.cpp index d1d70bb..549addd 100644 --- a/chromium_process/ChromiumApp.cpp +++ b/chromium_process/ChromiumApp.cpp @@ -174,15 +174,17 @@ void ChromiumApp::OnBeforeCommandLineProcessing( const CefString& process_type, command_line->AppendSwitch( "disable-smooth-scrolling" ); #ifdef _WIN32 command_line->AppendSwitch( "enable-begin-frame-scheduling" ); - - // TODO: WINE/Proton/Flatpak support? - //command_line->AppendSwitch( "no-sandbox" ); #endif - command_line->AppendSwitch( "enable-system-flash" ); // This can interfere with posix signals and break Breakpad #if defined(__linux__) || defined(__APPLE__) command_line->AppendSwitch( "disable-in-process-stack-traces" ); + + // Flatpak, AppImage, and Snap break sandboxing + // TODO(winter): It's not ideal to just outright turn off sandboxing...but Steam does it too, so + if (getenv("container") || getenv("APPIMAGE") || getenv("SNAP")) { + command_line->AppendSwitch("no-sandbox"); + } #endif #ifdef __APPLE__ diff --git a/html_chromium/ChromiumSystem.cpp b/html_chromium/ChromiumSystem.cpp index 0a8639e..e160cc7 100644 --- a/html_chromium/ChromiumSystem.cpp +++ b/html_chromium/ChromiumSystem.cpp @@ -35,14 +35,16 @@ class ChromiumApp command_line->AppendSwitch( "disable-smooth-scrolling" ); #ifdef _WIN32 command_line->AppendSwitch( "enable-begin-frame-scheduling" ); - // TODO: WINE/Proton/Flatpak support? - //command_line->AppendSwitch( "no-sandbox" ); #endif - command_line->AppendSwitch( "enable-system-flash" ); - // This can interfere with posix signals and break Breakpad #ifdef __linux__ command_line->AppendSwitch( "disable-in-process-stack-traces" ); + + // Flatpak, AppImage, and Snap break sandboxing + // TODO(winter): It's not ideal to just outright turn off sandboxing...but Steam does it too, so + if (getenv("container") || getenv("APPIMAGE") || getenv("SNAP")) { + command_line->AppendSwitch("no-sandbox"); + } #endif #ifdef __APPLE__