Skip to content

Commit

Permalink
Disable sandboxing if we seem to be running in Flatpak, AppImage, or …
Browse files Browse the repository at this point in the history
…Snap on Linux
  • Loading branch information
WinterPhoenix committed Apr 30, 2024
1 parent 92ebc22 commit 55f2555
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions chromium_process/ChromiumApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
10 changes: 6 additions & 4 deletions html_chromium/ChromiumSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down

0 comments on commit 55f2555

Please sign in to comment.