AK+Everywhere: Remove the char const* JSON value constructor

This commit is contained in:
Timothy Flynn 2025-02-17 11:59:45 -05:00 committed by Tim Flynn
commit 70eb0ba1cd
Notes: github-actions[bot] 2025-02-21 00:29:35 +00:00
10 changed files with 35 additions and 35 deletions

View file

@ -29,18 +29,23 @@ void DeviceActor::handle_message(StringView type, JsonObject const&)
if (type == "getDescription"sv) {
auto build_id = Core::Version::read_long_version_string().to_byte_string();
static constexpr auto browser_name = StringView { BROWSER_NAME, __builtin_strlen(BROWSER_NAME) };
static constexpr auto browser_version = StringView { BROWSER_VERSION, __builtin_strlen(BROWSER_VERSION) };
static constexpr auto platform_name = StringView { OS_STRING, __builtin_strlen(OS_STRING) };
static constexpr auto arch = StringView { CPU_STRING, __builtin_strlen(CPU_STRING) };
// https://github.com/mozilla/gecko-dev/blob/master/devtools/shared/system.js
JsonObject value;
value.set("apptype"sv, "ladybird"sv);
value.set("name"sv, BROWSER_NAME);
value.set("brandName"sv, BROWSER_NAME);
value.set("version"sv, BROWSER_VERSION);
value.set("apptype"sv, browser_name.to_lowercase_string());
value.set("name"sv, browser_name);
value.set("brandName"sv, browser_name);
value.set("version"sv, browser_version);
value.set("appbuildid"sv, build_id);
value.set("platformbuildid"sv, build_id);
value.set("platformversion"sv, "135.0"sv);
value.set("useragent"sv, Web::default_user_agent);
value.set("os"sv, OS_STRING);
value.set("arch"sv, CPU_STRING);
value.set("os"sv, platform_name);
value.set("arch"sv, arch);
JsonObject response;
response.set("from"sv, name());

View file

@ -193,7 +193,7 @@ JsonValue WalkerActor::serialize_node(JsonObject const& node) const
serialized.set("causesOverflow"sv, false);
serialized.set("containerType"sv, JsonValue {});
serialized.set("displayName"sv, name.to_lowercase());
serialized.set("displayType"sv, "block");
serialized.set("displayType"sv, "block"sv);
serialized.set("host"sv, JsonValue {});
serialized.set("isAfterPseudoElement"sv, false);
serialized.set("isAnonymous"sv, false);