gologin 1.0.47 → 1.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/gologin.js +17 -1
  2. package/package.json +1 -1
package/gologin.js CHANGED
@@ -255,7 +255,23 @@ class GoLogin {
255
255
  if (_.get(preferences, 'isM1')) {
256
256
  preferences.is_m1 = _.get(preferences, 'isM1');
257
257
  }
258
-
258
+
259
+ if (_.get(preferences, 'os') == 'android'){
260
+ const devicePixelRatio = _.get(preferences, "devicePixelRatio");
261
+ const deviceScaleFactorCeil = Math.ceil(devicePixelRatio || 3.5);
262
+ let deviceScaleFactor = devicePixelRatio;
263
+ if (deviceScaleFactorCeil === devicePixelRatio) {
264
+ deviceScaleFactor += 0.00000001;
265
+ }
266
+
267
+ preferences.mobile = {
268
+ enable: true,
269
+ width: parseInt(this.resolution.width, 10),
270
+ height: parseInt(this.resolution.height, 10),
271
+ device_scale_factor: deviceScaleFactor,
272
+ }
273
+ }
274
+
259
275
  preferences.mediaDevices = {
260
276
  enable: preferences.mediaDevices.enableMasking,
261
277
  videoInputs: preferences.mediaDevices.videoInputs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gologin",
3
- "version": "1.0.47",
3
+ "version": "1.0.48",
4
4
  "description": "A high-level API to control Orbita browser over GoLogin API",
5
5
  "main": "./gologin.js",
6
6
  "repository": {