1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 12:46:35 +01:00

Do not remove QtWebEngine/5.x.y from the default user agent to increase compatibility.

Many websites do not recognize the “Falkon” token and show a warning message
claiming the user is using an outdated version of Google Chrome, while they do
correctly recognize known Chromium forks as such.
An example showing this behavior is https://www.whatismybrowser.com/
This commit is contained in:
Bruno Pitrus 2022-08-22 22:10:35 +02:00
parent 7534bde02d
commit a6bc15b345
No known key found for this signature in database
GPG Key ID: 32B7566977935F75

View File

@ -28,7 +28,7 @@ UserAgentManager::UserAgentManager(QObject* parent)
, m_usePerDomainUserAgent(false) , m_usePerDomainUserAgent(false)
{ {
m_defaultUserAgent = QWebEngineProfile::defaultProfile()->httpUserAgent(); m_defaultUserAgent = QWebEngineProfile::defaultProfile()->httpUserAgent();
m_defaultUserAgent.replace(QRegularExpression(QSL("QtWebEngine/[^\\s]+")), QSL("Falkon/%1").arg(Qz::VERSION)); m_defaultUserAgent.replace(QRegularExpression(QSL("(QtWebEngine/[^\\s]+)")), QSL("Falkon/%1 \\1").arg(Qz::VERSION));
} }
void UserAgentManager::loadSettings() void UserAgentManager::loadSettings()