Session preload: leave programs a Chromium app starts from its own folder alone (#3121)

The browser flags were added to every program beside chrome-sandbox
that had no --type switch. Chrome's crash handler is such a program, so
it was started with --no-sandbox, rejected it and exited. A Chromium app
that starts a program from its own folder already passes that program
the arguments it needs, so those programs are left unchanged. Another
Chromium app started from it still gets the flags.
This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-11-24 00:12:02 -05:00
1 parent e349d2544e
commit a03ec8eb57
2 files changed
+36 -1

No files matched your search

+16
View File
@@ -122,6 +122,22 @@ class WebhelperPreloadTest(unittest.TestCase):
(root / "bin/app").touch()
self.assertEqual(self.argv(str(root / "bin/app")), [str(root / "bin/app"), "--no-sandbox"])
def test_a_chromium_app_starting_a_program_from_its_own_folder_leaves_it_alone(self):
handler = self.chromium("chrome-app", "chrome_crashpad_handler")
browser = self.tmp / "chrome-app/chrome"
shutil.copy(self.program, browser)
out = subprocess.run([str(browser), handler, "--database=/tmp/x"], env={"TEST_DISPLAY": ":0"},
capture_output=True, text=True, check=True).stdout.splitlines()
self.assertEqual([handler, "--database=/tmp/x"], out)
def test_a_chromium_app_starting_another_chromium_app_still_flags_it(self):
other = self.chromium("other-app", "chrome")
editor = self.tmp / "editor-app/code"
self.chromium("editor-app", "code")
shutil.copy(self.program, editor)
out = subprocess.run([str(editor), other], env={}, capture_output=True, text=True, check=True).stdout.splitlines()
self.assertEqual([other, "--no-sandbox"], out)
def test_with_an_x_display_chromium_apps_use_x11(self):
chrome = self.chromium("chromium-x11", "chrome")
self.assertEqual(self.argv(chrome, "--new-window", display=":0"),