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

Make Tor Browser/Orfox UA regexes compatible with Firefox 100 #6309

Merged
merged 1 commit into from
Mar 4, 2022

Conversation

legoktm
Copy link
Member

@legoktm legoktm commented Feb 28, 2022

Status

Ready for review

Description of Changes

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.

Testing

It's not possible to really test this since there's no TBB/Orbot version based on Firefox 100 in the wild, but we can fake it:

  • Copy the new regexes from source.js into your browser console.
  • Run "Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0".match(TBB_UA_REGEX) to verify 2-digit versions still match
  • Run "Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0".match(TBB_UA_REGEX) to verify a hypothetical 3-digit version will match.

Deployment

Any special considerations for deployment? None.

Checklist

  • I have written a test plan and validated it for this PR
  • These changes do not require documentation

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.
@legoktm legoktm requested a review from a team as a code owner February 28, 2022 19:41
Copy link
Contributor

@eaon eaon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks for making sure there's forwards compatibility!

@eaon eaon merged commit 8e61004 into develop Mar 4, 2022
@eaon eaon mentioned this pull request Mar 4, 2022
@legoktm legoktm deleted the firefox-100 branch December 8, 2022 21:37
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 this pull request may close these issues.

Update user-agent regexes for Firefox 100
2 participants