From 2a485d14bc949b64d0ea81ef053a9dce4ea97d27 Mon Sep 17 00:00:00 2001 From: Street Pea Date: Tue, 11 Feb 2025 15:34:05 -0800 Subject: [PATCH] Update chrome version in user agent string --- gui/src/qml/PSNLoginDialog.qml | 4 ++-- gui/src/qml/PSNTokenDialog.qml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gui/src/qml/PSNLoginDialog.qml b/gui/src/qml/PSNLoginDialog.qml index 8ae0cd8a..cf968e29 100644 --- a/gui/src/qml/PSNLoginDialog.qml +++ b/gui/src/qml/PSNLoginDialog.qml @@ -232,8 +232,8 @@ DialogView { } onCertificateError: console.error(error.description); }", webView, "webView"); - web.profile.httpUserAgent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36' - web.url = Chiaki.psnLoginUrl(); + web.profile.httpUserAgent = web.profile.httpUserAgent.replace(/\bQtWebEngine[^ ]*/, '') + web.profile.httpUserAgent = web.profile.httpUserAgent.replace(/\bChrome[^ ]*/, 'Chrome/135.0.0.0 ') web.url = Chiaki.psnLoginUrl(); web.anchors.fill = webView; } catch (error) { console.error('Create webengine view failed with error:' + error); diff --git a/gui/src/qml/PSNTokenDialog.qml b/gui/src/qml/PSNTokenDialog.qml index b7b0bec3..1ae03949 100644 --- a/gui/src/qml/PSNTokenDialog.qml +++ b/gui/src/qml/PSNTokenDialog.qml @@ -247,7 +247,8 @@ DialogView { } onCertificateError: console.error(error.description); }", webView, "webView"); - web.profile.httpUserAgent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36' + web.profile.httpUserAgent = web.profile.httpUserAgent.replace(/\bQtWebEngine[^ ]*/, '') + web.profile.httpUserAgent = web.profile.httpUserAgent.replace(/\bChrome[^ ]*/, 'Chrome/135.0.0.0 ') web.url = Chiaki.psnLoginUrl(); web.anchors.fill = webView; } catch (error) {