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.
This commit is contained in:
MacDue 2024-05-27 20:31:39 +01:00 committed by Andreas Kling
parent 9c711bc868
commit b3f63f35e5
Notes: sideshowbarker 2024-07-16 22:26:05 +09:00

View File

@ -105,6 +105,7 @@ ErrorOr<int> 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<int> 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;
}