mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-28 20:29:03 +00:00
UI/AppKit: Port --force-new-process option from Qt chrome
This commit is contained in:
parent
946ccfc108
commit
7604d15b99
Notes:
sideshowbarker
2024-07-18 00:41:35 +09:00
Author: https://github.com/SebastianZaha
Commit: 7604d15b99
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/536
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/trflynn89
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue