Skip to content

Commit

Permalink
feat: add more Android models to DeviceDescriptors (#7210)
Browse files Browse the repository at this point in the history
Adds device descriptions for:
* Galaxy S8
* Galaxy S9+
* Galaxy Tab S4
* Pixel 3
* Pixel 4

These devices are regarded as worthy of targeting by [BrowserStack](https://www.browserstack.com/test-on-the-right-mobile-devices).

Sources (both have identical data for these 5 devices):
1. https://github.com/aerokube/moon-deploy/blob/master/moon-local.yaml#L199
2. https://www.danhendricks.com/2018/04/adding-iphone-galaxy-chrome-mobile-emulated-devices/#heading_device_data
  • Loading branch information
mrienstra committed Sep 11, 2021
1 parent 8d1a697 commit b5020dc
Showing 1 changed file with 130 additions and 0 deletions.
130 changes: 130 additions & 0 deletions src/common/DeviceDescriptors.ts
Expand Up @@ -187,6 +187,84 @@ const devices: Device[] = [
isLandscape: true,
},
},
{
name: 'Galaxy S8',
userAgent:
'Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36',
viewport: {
width: 360,
height: 740,
deviceScaleFactor: 3,
isMobile: true,
hasTouch: true,
isLandscape: false,
},
},
{
name: 'Galaxy S8 landscape',
userAgent:
'Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36',
viewport: {
width: 740,
height: 360,
deviceScaleFactor: 3,
isMobile: true,
hasTouch: true,
isLandscape: true,
},
},
{
name: 'Galaxy S9+',
userAgent:
'Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Mobile Safari/537.36',
viewport: {
width: 320,
height: 658,
deviceScaleFactor: 4.5,
isMobile: true,
hasTouch: true,
isLandscape: false,
},
},
{
name: 'Galaxy S9+ landscape',
userAgent:
'Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Mobile Safari/537.36',
viewport: {
width: 658,
height: 320,
deviceScaleFactor: 4.5,
isMobile: true,
hasTouch: true,
isLandscape: true,
},
},
{
name: 'Galaxy Tab S4',
userAgent:
'Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Safari/537.36',
viewport: {
width: 712,
height: 1138,
deviceScaleFactor: 2.25,
isMobile: true,
hasTouch: true,
isLandscape: false,
},
},
{
name: 'Galaxy Tab S4 landscape',
userAgent:
'Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Safari/537.36',
viewport: {
width: 1138,
height: 712,
deviceScaleFactor: 2.25,
isMobile: true,
hasTouch: true,
isLandscape: true,
},
},
{
name: 'iPad',
userAgent:
Expand Down Expand Up @@ -1032,6 +1110,58 @@ const devices: Device[] = [
isLandscape: true,
},
},
{
name: 'Pixel 3',
userAgent:
'Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.158 Mobile Safari/537.36',
viewport: {
width: 393,
height: 786,
deviceScaleFactor: 2.75,
isMobile: true,
hasTouch: true,
isLandscape: false,
},
},
{
name: 'Pixel 3 landscape',
userAgent:
'Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.158 Mobile Safari/537.36',
viewport: {
width: 786,
height: 393,
deviceScaleFactor: 2.75,
isMobile: true,
hasTouch: true,
isLandscape: true,
},
},
{
name: 'Pixel 4',
userAgent:
'Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36',
viewport: {
width: 353,
height: 745,
deviceScaleFactor: 3,
isMobile: true,
hasTouch: true,
isLandscape: false,
},
},
{
name: 'Pixel 4 landscape',
userAgent:
'Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36',
viewport: {
width: 745,
height: 353,
deviceScaleFactor: 3,
isMobile: true,
hasTouch: true,
isLandscape: true,
},
},
];
/**
* @public
Expand Down

0 comments on commit b5020dc

Please sign in to comment.