gologin 1.0.38 → 1.0.39

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.
package/README.md CHANGED
@@ -65,15 +65,16 @@ const GoLogin = require('gologin');
65
65
 
66
66
  - `options` <[Object]> Options for profile
67
67
  - `autoUpdateBrowser` <[boolean]> do not ask whether download new browser version (default false)
68
- - `token` <[string]> your API <a href="https://gologin.com/#/personalArea/TokenApi" target="_blank">token</a>
69
- - `profile_id` <[string]> profile ID
70
- - `executablePath` <[string]> path to executable Orbita file. Orbita will be downloaded automatically if not specified.
68
+ - `token` <[string]> your API <a href="https://gologin.com/#/personalArea/TokenApi" target="_blank">token</a>
69
+ - `profile_id` <[string]> profile ID
70
+ - `executablePath` <[string]> path to executable Orbita file. Orbita will be downloaded automatically if not specified.
71
71
  - `remote_debugging_port` <[int]> port for remote debugging
72
- - `vncPort` <[integer]> port of VNC server if you using it
72
+ - `vncPort` <[integer]> port of VNC server if you using it
73
73
  - `tmpdir` <[string]> path to temporary directore for saving profiles
74
74
  - `extra_params` arrayof <[string]> extra params for browser orbita (ex. extentions etc.)
75
75
  - `uploadCookiesToServer` <[boolean]> upload cookies to server after profile stopping (default false)
76
76
  - `writeCookesFromServer` <[boolean]> download cookies from server and write to profile cookies file (default true)
77
+ - `skipOrbitaHashChecking` <[boolean]> skip hash checking for Orbita after downloading process (default false)
77
78
 
78
79
  ```js
79
80
  const GoLogin = require('gologin');
@@ -39,8 +39,10 @@ class BrowserChecker {
39
39
  #homedir;
40
40
  #browserPath;
41
41
  #executableFilePath;
42
+ #skipOrbitaHashChecking = false;
42
43
 
43
- constructor() {
44
+ constructor(skipOrbitaHashChecking) {
45
+ this.#skipOrbitaHashChecking = skipOrbitaHashChecking;
44
46
  this.#homedir = os.homedir();
45
47
  this.#browserPath = path.join(this.#homedir, '.gologin', 'browser');
46
48
 
@@ -221,6 +223,10 @@ class BrowserChecker {
221
223
  }
222
224
 
223
225
  async checkBrowserSum() {
226
+ if (this.#skipOrbitaHashChecking) {
227
+ return Promise.resolve();
228
+ }
229
+
224
230
  console.log('Orbita hash checking');
225
231
  if (PLATFORM === 'win32') {
226
232
  return Promise.resolve();
package/gologin.js CHANGED
@@ -8,7 +8,6 @@ const rimraf = util.promisify(require('rimraf'));
8
8
  const { access, unlink, writeFile, readFile } = require('fs').promises;
9
9
  const exec = util.promisify(require('child_process').exec);
10
10
  const { spawn, execFile } = require('child_process');
11
- const FormData = require('form-data');
12
11
  const ProxyAgent = require('simple-proxy-agent');
13
12
  const decompress = require('decompress');
14
13
  const decompressUnzip = require('decompress-unzip');
@@ -30,7 +29,7 @@ const OS_PLATFORM = process.platform;
30
29
  const delay = (time) => new Promise((resolve) => setTimeout(resolve, time));
31
30
 
32
31
  class GoLogin {
33
- constructor(options) {
32
+ constructor(options = {}) {
34
33
  this.is_remote = options.remote || false;
35
34
  this.access_token = options.token;
36
35
  this.profile_id = options.profile_id;
@@ -45,7 +44,7 @@ class GoLogin {
45
44
  this.profileOs = 'lin';
46
45
  this.tmpdir = os.tmpdir();
47
46
  this.autoUpdateBrowser = !!options.autoUpdateBrowser;
48
- this.browserChecker = new BrowserChecker();
47
+ this.browserChecker = new BrowserChecker(options.skipOrbitaHashChecking);
49
48
  this.uploadCookiesToServer = options.uploadCookiesToServer || false;
50
49
  this.writeCookesFromServer = options.writeCookesFromServer || true;
51
50
  this.remote_debugging_port = options.remote_debugging_port || 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gologin",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
4
4
  "description": "A high-level API to control Orbita browser over GoLogin API",
5
5
  "main": "./gologin.js",
6
6
  "repository": {