From e6fa7184294734c3397e74994533bf43a58e2b53 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Mon, 28 Feb 2022 11:35:52 -0800 Subject: [PATCH] Make Tor Browser/Orfox UA regexes compatible with Firefox 100 Per , Firefox will soon hit version 100, which will break any regex that is matching against a 2-digit version, like we do. Switch the regex to match against 3-digit versions as well, which should keep us going for another 900 versions. Fixes #6276. --- securedrop/static/js/source.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/securedrop/static/js/source.js b/securedrop/static/js/source.js index a270285896..2af98a6457 100644 --- a/securedrop/static/js/source.js +++ b/securedrop/static/js/source.js @@ -1,5 +1,5 @@ -const TBB_UA_REGEX = /Mozilla\/5\.0 \((Windows NT 10\.0|X11; Linux x86_64|Macintosh; Intel Mac OS X 10\.[0-9]{2}|Windows NT 10\.0; Win64; x64|Android; Mobile); rv:[0-9]{2}\.0\) Gecko\/20100101 Firefox\/([0-9]{2})\.0/ -const ORFOX_UA_REGEX = /Mozilla\/5\.0 \(Android; Mobile; rv:[0-9]{2}\.0\) Gecko\/20100101 Firefox\/([0-9]{2})\.0/; +const TBB_UA_REGEX = /Mozilla\/5\.0 \((Windows NT 10\.0|X11; Linux x86_64|Macintosh; Intel Mac OS X 10\.[0-9]{2}|Windows NT 10\.0; Win64; x64|Android; Mobile); rv:[0-9]{2,3}\.0\) Gecko\/20100101 Firefox\/([0-9]{2,3})\.0/ +const ORFOX_UA_REGEX = /Mozilla\/5\.0 \(Android; Mobile; rv:[0-9]{2,3}\.0\) Gecko\/20100101 Firefox\/([0-9]{2,3})\.0/; function fadeIn(el, duration = 200, displayStyle = "block") { const frameDuration = 16;