diff --git a/browser/extensions/webcompat/data/ua_overrides.js b/browser/extensions/webcompat/data/ua_overrides.js index 1669b437e21a..f1f1e31ca978 100644 --- a/browser/extensions/webcompat/data/ua_overrides.js +++ b/browser/extensions/webcompat/data/ua_overrides.js @@ -1379,21 +1379,20 @@ const AVAILABLE_UA_OVERRIDES = [ }, { /* - * Bug 1858664 - UA override to freeze rv segment to 109 + * Bug 1858664 - UA override for tesco.com * - * Some sites have issues with a UA string with "rv:" segment - * higher than 109, freezing it to 109 fixes the issues. + * tesco.com shows access denied with a UA string with "rv:" segment + * higher than 109, and version higher than 120. */ id: "bug1858664", platform: "all", - domain: "Sites with known breakage with rv: segment higher than 109", + domain: "tesco.com", bug: "1858664", config: { - matches: [ - "*://*.tesco.com/*", // #1858664 - ], + matches: ["*://*.tesco.com/*"], uaTransformer: originalUA => { - return UAHelpers.capRvTo109(originalUA); + const cappedRv = UAHelpers.capRvTo109(originalUA); + return UAHelpers.capVersionToNumber(cappedRv); }, }, }, diff --git a/browser/extensions/webcompat/lib/ua_helpers.js b/browser/extensions/webcompat/lib/ua_helpers.js index 22e0d9fcb325..2cc848f8b005 100644 --- a/browser/extensions/webcompat/lib/ua_helpers.js +++ b/browser/extensions/webcompat/lib/ua_helpers.js @@ -79,6 +79,14 @@ var UAHelpers = { } return originalUA.replace(`rv:${ver[1]}`, "rv:109.0"); }, + capVersionToNumber(originalUA, cap = 120) { + const ver = originalUA.match(/Firefox\/(\d+\.\d+)/); + if (!ver || parseFloat(ver[1]) <= cap) { + return originalUA; + } + const capped = `Firefox/${cap}.0`; + return originalUA.replace(`Firefox/${ver[1]}`, capped); + }, getWindowsUA(originalUA) { const rv = originalUA.match("rv:[0-9]+.[0-9]+")[0]; const ver = originalUA.match("Firefox/[0-9]+.[0-9]+")[0]; diff --git a/browser/extensions/webcompat/manifest.json b/browser/extensions/webcompat/manifest.json index 75a3c45a27f6..0ea6d3aa3527 100644 --- a/browser/extensions/webcompat/manifest.json +++ b/browser/extensions/webcompat/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "Web Compatibility Interventions", "description": "Urgent post-release fixes for web compatibility.", - "version": "120.0.0", + "version": "120.1.0", "browser_specific_settings": { "gecko": { "id": "webcompat@mozilla.org",