From 7f573d771705f760e1de5ede07175f33c493a861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Fri, 12 Apr 2024 10:34:39 +0300 Subject: [PATCH] Replace UA rv to potentially fix bot detection avoidance --- chrome/content/zotero/xpcom/zotero.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 7157db111f..cf3f3bc914 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -1936,7 +1936,11 @@ Zotero.VersionHeader = { // Default UA (not a faked UA from the connector if (pos != -1) { - ua = ua.slice(0, pos) + `Firefox/${info.platformVersion.match(/^\d+/)[0]}.0` + ua = ua.slice(0, pos) + `Firefox/${info.platformVersion.match(/^\d+/)[0]}.0`; + // To fix cloudflare bot detection. rv frozen to avoid some websites + // detecting us as IE11. See https://bugzilla.mozilla.org/show_bug.cgi?id=1806690 + // For some reason we are note getting this from the Firefox base. + ua = ua.replace('rv:115', 'rv:109'); } return ua;