mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 15:32:31 +00:00
AK+Everywhere: Remove the char const*
JSON value constructor
This commit is contained in:
parent
ee70f1327a
commit
70eb0ba1cd
Notes:
github-actions[bot]
2025-02-21 00:29:35 +00:00
Author: https://github.com/trflynn89
Commit: 70eb0ba1cd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3631
Reviewed-by: https://github.com/awesomekling ✅
10 changed files with 35 additions and 35 deletions
|
@ -236,6 +236,7 @@ static bool matches_platform_name(StringView requested_platform_name, StringView
|
|||
static JsonValue match_capabilities(JsonObject const& capabilities, SessionFlags flags)
|
||||
{
|
||||
static auto browser_name = StringView { BROWSER_NAME, strlen(BROWSER_NAME) }.to_lowercase_string();
|
||||
static constexpr auto browser_version = StringView { BROWSER_VERSION, __builtin_strlen(BROWSER_VERSION) };
|
||||
static auto platform_name = StringView { OS_STRING, strlen(OS_STRING) }.to_lowercase_string();
|
||||
|
||||
// 1. Let matched capabilities be a JSON Object with the following entries:
|
||||
|
@ -245,7 +246,7 @@ static JsonValue match_capabilities(JsonObject const& capabilities, SessionFlags
|
|||
matched_capabilities.set("browserName"sv, browser_name);
|
||||
// "browserVersion"
|
||||
// The user agent version, as a string.
|
||||
matched_capabilities.set("browserVersion"sv, BROWSER_VERSION);
|
||||
matched_capabilities.set("browserVersion"sv, browser_version);
|
||||
// "platformName"
|
||||
// ASCII Lowercase name of the current platform as a string.
|
||||
matched_capabilities.set("platformName"sv, platform_name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue