Skip to content

Commit 8737207

Browse files
authored
feat(devices): add more Android device descriptions (#6413)
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. 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
1 parent 765d749 commit 8737207

File tree

2 files changed

+120
-0
lines changed

2 files changed

+120
-0
lines changed

src/server/deviceDescriptors.js

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,72 @@ module.exports = {
151151
'hasTouch': true,
152152
'defaultBrowserType': 'chromium'
153153
},
154+
'Galaxy S8': {
155+
'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',
156+
'viewport': {
157+
'width': 360,
158+
'height': 740
159+
},
160+
'deviceScaleFactor': 3,
161+
'isMobile': true,
162+
'hasTouch': true,
163+
'defaultBrowserType': 'chromium'
164+
},
165+
'Galaxy S8 landscape': {
166+
'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',
167+
'viewport': {
168+
'width': 740,
169+
'height': 360
170+
},
171+
'deviceScaleFactor': 3,
172+
'isMobile': true,
173+
'hasTouch': true,
174+
'defaultBrowserType': 'chromium'
175+
},
176+
'Galaxy S9+': {
177+
'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',
178+
'viewport': {
179+
'width': 320,
180+
'height': 658
181+
},
182+
'deviceScaleFactor': 4.5,
183+
'isMobile': true,
184+
'hasTouch': true,
185+
'defaultBrowserType': 'chromium'
186+
},
187+
'Galaxy S9+ landscape': {
188+
'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',
189+
'viewport': {
190+
'width': 658,
191+
'height': 320
192+
},
193+
'deviceScaleFactor': 4.5,
194+
'isMobile': true,
195+
'hasTouch': true,
196+
'defaultBrowserType': 'chromium'
197+
},
198+
'Galaxy Tab S4': {
199+
'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',
200+
'viewport': {
201+
'width': 712,
202+
'height': 1138
203+
},
204+
'deviceScaleFactor': 2.25,
205+
'isMobile': true,
206+
'hasTouch': true,
207+
'defaultBrowserType': 'chromium'
208+
},
209+
'Galaxy Tab S4 landscape': {
210+
'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',
211+
'viewport': {
212+
'width': 1138,
213+
'height': 712
214+
},
215+
'deviceScaleFactor': 2.25,
216+
'isMobile': true,
217+
'hasTouch': true,
218+
'defaultBrowserType': 'chromium'
219+
},
154220
'iPad (gen 6)': {
155221
'userAgent': 'Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Mobile/15E148 Safari/604.1',
156222
'viewport': {
@@ -969,6 +1035,50 @@ module.exports = {
9691035
'hasTouch': true,
9701036
'defaultBrowserType': 'chromium'
9711037
},
1038+
'Pixel 3': {
1039+
'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',
1040+
'viewport': {
1041+
'width': 393,
1042+
'height': 786
1043+
},
1044+
'deviceScaleFactor': 2.75,
1045+
'isMobile': true,
1046+
'hasTouch': true,
1047+
'defaultBrowserType': 'chromium'
1048+
},
1049+
'Pixel 3 landscape': {
1050+
'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',
1051+
'viewport': {
1052+
'width': 786,
1053+
'height': 393
1054+
},
1055+
'deviceScaleFactor': 2.75,
1056+
'isMobile': true,
1057+
'hasTouch': true,
1058+
'defaultBrowserType': 'chromium'
1059+
},
1060+
'Pixel 4': {
1061+
'userAgent': 'Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36',
1062+
'viewport': {
1063+
'width': 353,
1064+
'height': 745
1065+
},
1066+
'deviceScaleFactor': 3,
1067+
'isMobile': true,
1068+
'hasTouch': true,
1069+
'defaultBrowserType': 'chromium'
1070+
},
1071+
'Pixel 4 landscape': {
1072+
'userAgent': 'Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36',
1073+
'viewport': {
1074+
'width': 745,
1075+
'height': 353
1076+
},
1077+
'deviceScaleFactor': 3,
1078+
'isMobile': true,
1079+
'hasTouch': true,
1080+
'defaultBrowserType': 'chromium'
1081+
},
9721082
'Pixel 4a (5G)': {
9731083
'userAgent': 'Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.105 Mobile Safari/537.36',
9741084
'screen': {

types/types.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11088,6 +11088,12 @@ type Devices = {
1108811088
"Galaxy S III landscape": DeviceDescriptor;
1108911089
"Galaxy S5": DeviceDescriptor;
1109011090
"Galaxy S5 landscape": DeviceDescriptor;
11091+
"Galaxy S8": DeviceDescriptor;
11092+
"Galaxy S8 landscape": DeviceDescriptor;
11093+
"Galaxy S9+": DeviceDescriptor;
11094+
"Galaxy S9+ landscape": DeviceDescriptor;
11095+
"Galaxy Tab S4": DeviceDescriptor;
11096+
"Galaxy Tab S4 landscape": DeviceDescriptor;
1109111097
"iPad (gen 6)": DeviceDescriptor;
1109211098
"iPad (gen 6) landscape": DeviceDescriptor;
1109311099
"iPad (gen 7)": DeviceDescriptor;
@@ -11158,6 +11164,10 @@ type Devices = {
1115811164
"Pixel 2 landscape": DeviceDescriptor;
1115911165
"Pixel 2 XL": DeviceDescriptor;
1116011166
"Pixel 2 XL landscape": DeviceDescriptor;
11167+
"Pixel 3": DeviceDescriptor;
11168+
"Pixel 3 landscape": DeviceDescriptor;
11169+
"Pixel 4": DeviceDescriptor;
11170+
"Pixel 4 landscape": DeviceDescriptor;
1116111171
"Pixel 4a (5G)": DeviceDescriptor;
1116211172
"Pixel 4a (5G) landscape": DeviceDescriptor;
1116311173
"Pixel 5": DeviceDescriptor;

0 commit comments

Comments
 (0)