mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWebView+WebContent: Inform WebContent process if browser is headless
This commit is contained in:
parent
520bf6c9be
commit
e764df15eb
Notes:
github-actions[bot]
2024-12-10 18:32:56 +00:00
Author: https://github.com/tcl3
Commit: e764df15eb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2858
Reviewed-by: https://github.com/trflynn89
9 changed files with 31 additions and 0 deletions
|
@ -108,6 +108,8 @@ ErrorOr<NonnullRefPtr<WebView::WebContentClient>> launch_web_content_process(
|
|||
arguments.append("--force-fontconfig"sv);
|
||||
if (web_content_options.collect_garbage_on_every_allocation == WebView::CollectGarbageOnEveryAllocation::Yes)
|
||||
arguments.append("--collect-garbage-on-every-allocation"sv);
|
||||
if (web_content_options.is_headless == WebView::IsHeadless::Yes)
|
||||
arguments.append("--headless"sv);
|
||||
|
||||
if (auto const maybe_echo_server_port = web_content_options.echo_server_port; maybe_echo_server_port.has_value()) {
|
||||
arguments.append("--echo-server-port"sv);
|
||||
|
|
|
@ -113,6 +113,11 @@ enum class CollectGarbageOnEveryAllocation {
|
|||
Yes,
|
||||
};
|
||||
|
||||
enum class IsHeadless {
|
||||
No,
|
||||
Yes,
|
||||
};
|
||||
|
||||
struct WebContentOptions {
|
||||
String command_line;
|
||||
String executable_path;
|
||||
|
@ -128,6 +133,7 @@ struct WebContentOptions {
|
|||
EnableAutoplay enable_autoplay { EnableAutoplay::No };
|
||||
CollectGarbageOnEveryAllocation collect_garbage_on_every_allocation { CollectGarbageOnEveryAllocation::No };
|
||||
Optional<u16> echo_server_port {};
|
||||
IsHeadless is_headless { IsHeadless::No };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue