Make Tor Browser/Orfox UA regexes compatible with Firefox 100 #6309
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
"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"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