mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
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:
parent
9c711bc868
commit
b3f63f35e5
Notes:
sideshowbarker
2024-07-16 22:26:05 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/b3f63f35e5 Pull-request: https://github.com/SerenityOS/serenity/pull/24465 Issue: https://github.com/SerenityOS/serenity/issues/24252 Reviewed-by: https://github.com/kalenikaliaksandr ✅
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user