Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update user-agent regexes for Firefox 100 #6276

Closed
legoktm opened this issue Feb 16, 2022 · 0 comments · Fixed by #6309
Closed

Update user-agent regexes for Firefox 100 #6276

legoktm opened this issue Feb 16, 2022 · 0 comments · Fixed by #6309
Assignees

Comments

@legoktm
Copy link
Member

legoktm commented Feb 16, 2022

Description

See https://hacks.mozilla.org/2022/02/version-100-in-chrome-and-firefox/.

Firefox is going to hit major version 100 soon, which means our regexes that match against a 2 digit major version will stop working.

Steps to Reproduce

In source.js:

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/;

The current TBB UA is Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0. Presumably it'll be s/91\.0/100.0/g whenever the time comes.

Expected Behavior

>>> "Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0".match(TBB_UA_REGEX)
Array(3) [ "Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0", "X11; Linux x86_64", "91" ]

Actual Behavior

>>> "Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0".match(TBB_UA_REGEX)
null

Comments

Given that we specifically look for TBB and Orfox, I don't think we need to rush to meet Chrome's March release date nor Firefox's May one because TBB will be on Firefox 91 ESR for quite a while more.

@legoktm legoktm self-assigned this Feb 28, 2022
legoktm added a commit that referenced this issue Feb 28, 2022
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.
@eaon eaon closed this as completed in #6309 Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant