From b3f63f35e5a6d9536871fa2df089daa48dabb856 Mon Sep 17 00:00:00 2001 From: MacDue Date: Mon, 27 May 2024 20:31:39 +0100 Subject: [PATCH] Ladybird: Add `--force-new-process` option This option skips attempting any chrome IPC which even with the `--new-window` does not open a new browser process. This is annoying when trying to compare browser options as opening a new window with the currently running chrome ignores any options passed to the new ladybird invocation. --- Ladybird/Qt/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Ladybird/Qt/main.cpp b/Ladybird/Qt/main.cpp index d4683e0a512..a02b53bfadf 100644 --- a/Ladybird/Qt/main.cpp +++ b/Ladybird/Qt/main.cpp @@ -105,6 +105,7 @@ ErrorOr serenity_main(Main::Arguments arguments) bool log_all_js_exceptions = false; bool enable_idl_tracing = false; bool new_window = false; + bool force_new_process = false; Core::ArgsParser args_parser; args_parser.set_general_help("The Ladybird web browser :^)"); @@ -121,10 +122,11 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.add_option(enable_idl_tracing, "Enable IDL tracing", "enable-idl-tracing"); args_parser.add_option(expose_internals_object, "Expose internals object", "expose-internals-object"); args_parser.add_option(new_window, "Force opening in a new window", "new-window", 'n'); + args_parser.add_option(force_new_process, "Force creation of new browser/chrome process", "force-new-process"); args_parser.parse(arguments); WebView::ChromeProcess chrome_process; - if (TRY(chrome_process.connect(raw_urls, new_window)) == WebView::ChromeProcess::ProcessDisposition::ExitProcess) { + if (!force_new_process && TRY(chrome_process.connect(raw_urls, new_window)) == WebView::ChromeProcess::ProcessDisposition::ExitProcess) { outln("Opening in existing process"); return 0; }