Home >Web Front-end >CSS Tutorial >Three-Digit Browser Versions in March 2022
While relying on browser User-Agent strings for decision-making is generally discouraged, it's a common practice. A significant change is approaching, namely the transition to three-digit browser version numbers.
Karl Dubost highlights this shift, particularly noting Firefox's planned transition:
Firefox Nightly is projected to reach version 100 in the first quarter of 2022 (likely March), leading to a stable release around May 2022 (subject to change). Chrome's release calendar also indicates a similar timeframe, around March 29, 2022.
This means User-Agent strings will soon resemble:
<code>Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:100.0) Gecko/20100101 Firefox/100.0</code>
<code>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.0.0 Safari/537.36</code>
This update poses challenges. Poorly constructed regular expressions (regex) will inevitably cause issues, and even simple string comparisons could fail, as Karl points out:
<code>"80"</code>
It's crucial to review code that uses navigator.userAgent
and update accordingly to avoid compatibility problems with these upcoming three-digit version numbers. A thorough code audit is recommended.
The above is the detailed content of Three-Digit Browser Versions in March 2022. For more information, please follow other related articles on the PHP Chinese website!