gologin 1.0.56 → 1.0.57

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.
@@ -13,24 +13,24 @@ const readline = require('readline');
13
13
  const PLATFORM = process.platform;
14
14
 
15
15
  const VERSION_FILE = 'latest-version.txt';
16
- const MAC_VERSION_FILE_URL = `https://orbita-browser-mac.gologin.com/${VERSION_FILE}`;
17
- const DEB_VERSION_FILE_URL = `https://orbita-browser-linux.gologin.com/${VERSION_FILE}`;
18
- const WIN_VERSION_FILE_URL = `https://orbita-browser-windows.gologin.com/${VERSION_FILE}`;
16
+ const MAC_VERSION_FILE_URL = `https://orbita-browser-mac-wc.gologin.com/${VERSION_FILE}`;
17
+ const DEB_VERSION_FILE_URL = `https://orbita-browser-linux-wc.gologin.com/${VERSION_FILE}`;
18
+ const WIN_VERSION_FILE_URL = `https://orbita-browser-windows-wc.gologin.com/${VERSION_FILE}`;
19
19
 
20
20
  const WIN_FOLDERSIZE_FILE = 'foldersize.txt';
21
21
  const WIN_FOLDERSIZE_FILE_LINK = `https://orbita-browser-windows.gologin.com/${WIN_FOLDERSIZE_FILE}`;
22
22
 
23
23
  const BROWSER_ARCHIVE_NAME = `orbita-browser-latest.${PLATFORM === 'win32' ? 'zip' : 'tar.gz'}`;
24
- const MAC_BROWSER_LINK = `https://orbita-browser-mac.gologin.com/${BROWSER_ARCHIVE_NAME}`;
25
- const DEB_BROWSER_LINK = `https://orbita-browser-linux.gologin.com/${BROWSER_ARCHIVE_NAME}`;
26
- const WIN_BROWSER_LINK = `https://orbita-browser-windows.gologin.com/${BROWSER_ARCHIVE_NAME}`;
24
+ const MAC_BROWSER_LINK = `https://orbita-browser-mac-wc.gologin.com/${BROWSER_ARCHIVE_NAME}`;
25
+ const DEB_BROWSER_LINK = `https://orbita-browser-linux-wc.gologin.com/${BROWSER_ARCHIVE_NAME}`;
26
+ const WIN_BROWSER_LINK = `https://orbita-browser-windows-wc.gologin.com/${BROWSER_ARCHIVE_NAME}`;
27
27
 
28
28
  const MAC_HASH_FILE = 'hashfile.mtree';
29
29
  const DEB_HASH_FILE = 'hashfile.txt';
30
30
  const WIN_HASH_FILE = DEB_HASH_FILE;
31
- const MAC_HASHFILE_LINK = `https://orbita-browser-mac.gologin.com/${MAC_HASH_FILE}`;
32
- const DEB_HASHFILE_LINK = `https://orbita-browser-linux.gologin.com/${DEB_HASH_FILE}`;
33
- const WIN_HASHFILE_LINK = `https://orbita-browser-windows.gologin.com/${WIN_HASH_FILE}`;
31
+ const MAC_HASHFILE_LINK = `https://orbita-browser-mac-wc.gologin.com/${MAC_HASH_FILE}`;
32
+ const DEB_HASHFILE_LINK = `https://orbita-browser-linux-wc.gologin.com/${DEB_HASH_FILE}`;
33
+ const WIN_HASHFILE_LINK = `https://orbita-browser-windows-wc.gologin.com/${WIN_HASH_FILE}`;
34
34
 
35
35
  const FAIL_SUM_MATCH_MESSAGE = 'hash_sum_not_matched';
36
36
  const EXTRACTED_FOLDER = 'extracted-browser';
@@ -55,7 +55,7 @@ class BrowserChecker {
55
55
  this.#executableFilePath = executableFilePath;
56
56
  // console.log('executableFilePath:', executableFilePath);
57
57
  }
58
-
58
+
59
59
  async checkBrowser(autoUpdateBrowser = false) {
60
60
  const browserFolderExists = await access(this.#executableFilePath).then(() => true).catch(() => false);
61
61
 
@@ -106,7 +106,7 @@ class BrowserChecker {
106
106
  } else if (PLATFORM === 'darwin') {
107
107
  link = MAC_BROWSER_LINK;
108
108
  }
109
-
109
+
110
110
  await this.downloadBrowserArchive(link, pathStr);
111
111
  await this.checkBrowserArchive(pathStr);
112
112
  await this.extractBrowser();
@@ -116,7 +116,7 @@ class BrowserChecker {
116
116
  await this.deleteOldArchives();
117
117
  console.log('Orbita updated successfully');
118
118
  }
119
-
119
+
120
120
  downloadBrowserArchive(link, pathStr) {
121
121
  return new Promise((resolve, reject) => {
122
122
  const writableStream = fs.createWriteStream(pathStr);
@@ -287,7 +287,7 @@ class BrowserChecker {
287
287
  targetBrowserPath
288
288
  );
289
289
  }
290
-
290
+
291
291
  async deleteOldArchives(deleteCurrentBrowser = false) {
292
292
  if (deleteCurrentBrowser) {
293
293
  return this.deleteDir(path.join(this.#browserPath));
package/gologin.js CHANGED
@@ -44,6 +44,7 @@ class GoLogin {
44
44
  this.is_stopping = false;
45
45
  this.differentOs = false;
46
46
  this.profileOs = 'lin';
47
+ this.waitWebsocket = !!options.waitWebsocket;
47
48
  this.tmpdir = os.tmpdir();
48
49
  this.autoUpdateBrowser = !!options.autoUpdateBrowser;
49
50
  this.browserChecker = new BrowserChecker(options.skipOrbitaHashChecking);
@@ -848,14 +849,17 @@ class GoLogin {
848
849
  debug('SPAWN CMD', ORBITA_BROWSER, params.join(" "));
849
850
  }
850
851
 
851
- debug('GETTING WS URL FROM BROWSER');
852
852
 
853
- let data = await requests.get(`http://127.0.0.1:${remote_debugging_port}/json/version`, {json: true});
853
+ if(this.waitWebsocket){
854
+ debug('GETTING WS URL FROM BROWSER');
855
+ let data = await requests.get(`http://127.0.0.1:${remote_debugging_port}/json/version`, {json: true});
854
856
 
855
- debug('WS IS', _.get(data, 'body.webSocketDebuggerUrl', ''))
856
- this.is_active = true;
857
+ debug('WS IS', _.get(data, 'body.webSocketDebuggerUrl', ''))
858
+ this.is_active = true;
857
859
 
858
- return _.get(data, 'body.webSocketDebuggerUrl', '');
860
+ return _.get(data, 'body.webSocketDebuggerUrl', '');
861
+ }
862
+ return '';
859
863
  }
860
864
 
861
865
  async createStartupAndSpawnBrowser() {
@@ -933,6 +937,8 @@ class GoLogin {
933
937
  `${SEPARATOR}oofiananboodjbbmdelgdommihjbkfag`,
934
938
  `${SEPARATOR}SafetyTips`,
935
939
  `${SEPARATOR}fonts`,
940
+ `${SEPARATOR}BrowserMetrics`,
941
+ `${SEPARATOR}BrowserMetrics-spare.pma`,
936
942
  ];
937
943
  const that = this;
938
944
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gologin",
3
- "version": "1.0.56",
3
+ "version": "1.0.57",
4
4
  "description": "A high-level API to control Orbita browser over GoLogin API",
5
5
  "main": "./gologin.js",
6
6
  "repository": {