Skip to content

Commit

Permalink
Set user agent to a valid Google Chrome release
Browse files Browse the repository at this point in the history
This was the latest version as of 20/01/24.
  • Loading branch information
iscle authored and xeco23 committed Jan 22, 2024
1 parent ab065bb commit d3b7387
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ui/WebView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace wfl::ui
namespace
{
constexpr auto const WHATSAPP_WEB_URI = "https://web.whatsapp.com";
constexpr auto const USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36";

std::optional<std::string> getSystemLanguage()
{
Expand Down Expand Up @@ -186,6 +187,7 @@ namespace wfl::ui
}

auto const settings = webkit_web_view_get_settings(*this);
webkit_settings_set_user_agent(settings, USER_AGENT);
webkit_settings_set_enable_developer_extras(settings, TRUE);
auto hwAccelPolicy = static_cast<WebKitHardwareAccelerationPolicy>(util::Settings::getInstance().getValue<int>("web", "hw-accel", 1));
webkit_settings_set_hardware_acceleration_policy(settings, hwAccelPolicy);
Expand Down

0 comments on commit d3b7387

Please sign in to comment.