mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
UI/AppKit: Port --force-new-process option from Qt chrome
This commit is contained in:
committed by
Andrew Kaster
parent
946ccfc108
commit
7604d15b99
@@ -88,6 +88,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||||||
bool log_all_js_exceptions = false;
|
bool log_all_js_exceptions = false;
|
||||||
bool enable_http_cache = false;
|
bool enable_http_cache = false;
|
||||||
bool new_window = false;
|
bool new_window = false;
|
||||||
|
bool force_new_process = false;
|
||||||
bool allow_popups = false;
|
bool allow_popups = false;
|
||||||
|
|
||||||
Core::ArgsParser args_parser;
|
Core::ArgsParser args_parser;
|
||||||
@@ -100,11 +101,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||||||
args_parser.add_option(log_all_js_exceptions, "Log all JavaScript exceptions", "log-all-js-exceptions");
|
args_parser.add_option(log_all_js_exceptions, "Log all JavaScript exceptions", "log-all-js-exceptions");
|
||||||
args_parser.add_option(enable_http_cache, "Enable HTTP cache", "enable-http-cache");
|
args_parser.add_option(enable_http_cache, "Enable HTTP cache", "enable-http-cache");
|
||||||
args_parser.add_option(new_window, "Force opening in a new window", "new-window", 'n');
|
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.add_option(allow_popups, "Disable popup blocking by default", "allow-popups");
|
args_parser.add_option(allow_popups, "Disable popup blocking by default", "allow-popups");
|
||||||
args_parser.parse(arguments);
|
args_parser.parse(arguments);
|
||||||
|
|
||||||
WebView::ChromeProcess chrome_process;
|
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");
|
outln("Opening in existing process");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user