Skip to content

Commit

Permalink
Make Tor Browser/Orfox UA regexes compatible with Firefox 100
Browse files Browse the repository at this point in the history
Per <https://hacks.mozilla.org/2022/02/version-100-in-chrome-and-firefox/>,
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.
  • Loading branch information
legoktm committed Feb 28, 2022
1 parent a5f7e39 commit e6fa718
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions securedrop/static/js/source.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit e6fa718

Please sign in to comment.