gologin 1.0.55 → 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.
- package/browser-checker.js +13 -13
- package/gologin.js +12 -5
- package/package.json +1 -1
package/browser-checker.js
CHANGED
|
@@ -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);
|
|
@@ -503,6 +504,7 @@ class GoLogin {
|
|
|
503
504
|
};
|
|
504
505
|
profile.geoLocation = this.getGeolocationParams(profileGeolocation, tzGeoLocation);
|
|
505
506
|
profile.name = name;
|
|
507
|
+
profile.name_base64 = Buffer.from(name).toString('base64');
|
|
506
508
|
profile.profile_id = this.profile_id;
|
|
507
509
|
|
|
508
510
|
profile.webRtc = {
|
|
@@ -847,14 +849,17 @@ class GoLogin {
|
|
|
847
849
|
debug('SPAWN CMD', ORBITA_BROWSER, params.join(" "));
|
|
848
850
|
}
|
|
849
851
|
|
|
850
|
-
debug('GETTING WS URL FROM BROWSER');
|
|
851
852
|
|
|
852
|
-
|
|
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});
|
|
853
856
|
|
|
854
|
-
|
|
855
|
-
|
|
857
|
+
debug('WS IS', _.get(data, 'body.webSocketDebuggerUrl', ''))
|
|
858
|
+
this.is_active = true;
|
|
856
859
|
|
|
857
|
-
|
|
860
|
+
return _.get(data, 'body.webSocketDebuggerUrl', '');
|
|
861
|
+
}
|
|
862
|
+
return '';
|
|
858
863
|
}
|
|
859
864
|
|
|
860
865
|
async createStartupAndSpawnBrowser() {
|
|
@@ -932,6 +937,8 @@ class GoLogin {
|
|
|
932
937
|
`${SEPARATOR}oofiananboodjbbmdelgdommihjbkfag`,
|
|
933
938
|
`${SEPARATOR}SafetyTips`,
|
|
934
939
|
`${SEPARATOR}fonts`,
|
|
940
|
+
`${SEPARATOR}BrowserMetrics`,
|
|
941
|
+
`${SEPARATOR}BrowserMetrics-spare.pma`,
|
|
935
942
|
];
|
|
936
943
|
const that = this;
|
|
937
944
|
|