From d3b7387f28b6888c698a363513edf55e654c439d Mon Sep 17 00:00:00 2001 From: Iscle Date: Sat, 20 Jan 2024 01:41:17 +0100 Subject: [PATCH] Set user agent to a valid Google Chrome release This was the latest version as of 20/01/24. --- src/ui/WebView.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ui/WebView.cpp b/src/ui/WebView.cpp index 2f066a0..8145d29 100644 --- a/src/ui/WebView.cpp +++ b/src/ui/WebView.cpp @@ -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 getSystemLanguage() { @@ -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(util::Settings::getInstance().getValue("web", "hw-accel", 1)); webkit_settings_set_hardware_acceleration_policy(settings, hwAccelPolicy);