LibWeb: Restore handling of the serenity:ladybird/headless capability

This was refactored a bit incorrectly in d8fde14.
This commit is contained in:
Timothy Flynn 2023-02-02 07:08:28 -05:00 committed by Linus Groh
parent 9347db6f91
commit 792258afe8
Notes: sideshowbarker 2024-07-17 00:54:56 +09:00

View File

@ -52,7 +52,7 @@ static Response deserialize_as_ladybird_options(JsonValue value)
auto const& object = value.as_object();
if (auto headless = object.get_bool("headless"sv); headless.has_value())
if (auto headless = object.get("headless"sv); headless.has_value() && !headless->is_bool())
return Error::from_code(ErrorCode::InvalidArgument, "Extension capability serenity:ladybird/headless must be a boolean"sv);
return value;