1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Update outdated browser versions (#18721)

The range of browsers considered to be outdated has been updated to
match our latest browser support policy, which is ~2 years on Chrome,
and the most recent end-of-life extended support release on Firefox.

Comments have been added to help explain how these versions were chosen
as well.
This commit is contained in:
Mark Stacey 2023-04-21 12:03:46 -02:30 committed by Dan Miller
parent 0a9c6023dc
commit 1626f22704
2 changed files with 16 additions and 12 deletions

View File

@ -20,8 +20,12 @@ export const SUPPORT_REQUEST_LINK = _supportRequestLink;
export const CONTRACT_ADDRESS_LINK = _contractAddressLink;
export const PASSWORD_MIN_LENGTH = 8;
export const OUTDATED_BROWSER_VERSIONS = {
chrome: '<80',
edge: '<80',
firefox: '<78',
opera: '<67',
// Chrome and Edge should match the latest Chrome version released ~2 years ago
chrome: '<90',
edge: '<90',
// Firefox should match the most recent end-of-life extended support release
firefox: '<91',
// Opera should be set to the equivalent of the Chrome version set
// See https://en.wikipedia.org/wiki/History_of_the_Opera_web_browser
opera: '<76',
};

View File

@ -204,56 +204,56 @@ describe('util', () => {
});
it('should return false when given a modern chrome browser', () => {
const browser = Bowser.getParser(
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.2623.112 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.2623.112 Safari/537.36',
);
const result = util.getIsBrowserDeprecated(browser);
expect(result).toStrictEqual(false);
});
it('should return true when given an outdated chrome browser', () => {
const browser = Bowser.getParser(
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.2623.112 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.2623.112 Safari/537.36',
);
const result = util.getIsBrowserDeprecated(browser);
expect(result).toStrictEqual(true);
});
it('should return false when given a modern firefox browser', () => {
const browser = Bowser.getParser(
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/91.0',
);
const result = util.getIsBrowserDeprecated(browser);
expect(result).toStrictEqual(false);
});
it('should return true when given an outdated firefox browser', () => {
const browser = Bowser.getParser(
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/90.0',
);
const result = util.getIsBrowserDeprecated(browser);
expect(result).toStrictEqual(true);
});
it('should return false when given a modern opera browser', () => {
const browser = Bowser.getParser(
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_16_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.3578.98 Safari/537.36 OPR/68.0.3135.47',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_16_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.3578.98 Safari/537.36 OPR/76.0.3135.47',
);
const result = util.getIsBrowserDeprecated(browser);
expect(result).toStrictEqual(false);
});
it('should return true when given an outdated opera browser', () => {
const browser = Bowser.getParser(
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_16_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36 OPR/58.0.3135.47',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_16_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.3578.98 Safari/537.36 OPR/58.0.3135.47',
);
const result = util.getIsBrowserDeprecated(browser);
expect(result).toStrictEqual(true);
});
it('should return false when given a modern edge browser', () => {
const browser = Bowser.getParser(
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.3578.98 Safari/537.36 Edg/81.0.416.68',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.3578.98 Safari/537.36 Edg/90.0.416.68',
);
const result = util.getIsBrowserDeprecated(browser);
expect(result).toStrictEqual(false);
});
it('should return true when given an outdated edge browser', () => {
const browser = Bowser.getParser(
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36 Edge/71.0.416.68',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.3578.98 Safari/537.36 Edge/89.0.416.68',
);
const result = util.getIsBrowserDeprecated(browser);
expect(result).toStrictEqual(true);