mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb+WebDriver: Add a flag to default WebDriver to headless mode
We previously only supported enabling headless mode on a per-session basis via the capabilities record. We don't have the ability to mutate this record from WPT, so this adds a flag to set the default mode.
This commit is contained in:
parent
a67018b2fc
commit
b24a7079f1
Notes:
github-actions[bot]
2024-10-22 03:25:32 +00:00
Author: https://github.com/trflynn89
Commit: b24a7079f1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1907
Reviewed-by: https://github.com/tcl3 ✅
3 changed files with 19 additions and 1 deletions
|
@ -72,6 +72,13 @@ static ErrorOr<JsonObject, Error> deserialize_as_a_proxy(JsonValue parameter)
|
|||
return proxy;
|
||||
}
|
||||
|
||||
static InterfaceMode default_interface_mode { InterfaceMode::Graphical };
|
||||
|
||||
void set_default_interface_mode(InterfaceMode interface_mode)
|
||||
{
|
||||
default_interface_mode = interface_mode;
|
||||
}
|
||||
|
||||
static Response deserialize_as_ladybird_options(JsonValue value)
|
||||
{
|
||||
if (!value.is_object())
|
||||
|
@ -88,7 +95,7 @@ static Response deserialize_as_ladybird_options(JsonValue value)
|
|||
static JsonObject default_ladybird_options()
|
||||
{
|
||||
JsonObject options;
|
||||
options.set("headless"sv, false);
|
||||
options.set("headless"sv, default_interface_mode == InterfaceMode::Headless);
|
||||
|
||||
return options;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue