gologin 2.1.33 → 2.2.1
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/.eslintrc.json +14 -2
- package/CHANGELOG.md +17 -1
- package/package.json +5 -2
- package/src/browser/browser-checker.js +4 -17
- package/src/gologin.js +36 -20
- package/src/utils/browser.js +5 -0
- package/src/utils/common.js +6 -4
- package/src/utils/http.js +5 -1
- package/src/utils/sentry.js +2 -2
- package/.sentry-native/3af76fbc-ac64-4947-d1bf-0ab01540301f.run.lock +0 -0
package/.eslintrc.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
"es2021": true,
|
|
5
5
|
"node": true
|
|
6
6
|
},
|
|
7
|
+
"parser": "@babel/eslint-parser",
|
|
7
8
|
"extends": "eslint:recommended",
|
|
8
9
|
"overrides": [
|
|
9
10
|
{
|
|
@@ -20,8 +21,19 @@
|
|
|
20
21
|
}
|
|
21
22
|
],
|
|
22
23
|
"parserOptions": {
|
|
23
|
-
"ecmaVersion":
|
|
24
|
-
"sourceType": "module"
|
|
24
|
+
"ecmaVersion": "latest",
|
|
25
|
+
"sourceType": "module",
|
|
26
|
+
"requireConfigFile": false,
|
|
27
|
+
"babelOptions": {
|
|
28
|
+
"plugins": [
|
|
29
|
+
[
|
|
30
|
+
"@babel/plugin-syntax-import-assertions",
|
|
31
|
+
{
|
|
32
|
+
"deprecatedAssertSyntax": true
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
]
|
|
36
|
+
}
|
|
25
37
|
},
|
|
26
38
|
"plugins": [
|
|
27
39
|
"simple-import-sort"
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Combined changelog for GoLogin node.js SDK
|
|
4
4
|
|
|
5
|
+
### New
|
|
6
|
+
|
|
7
|
+
* Secured Orbita launch
|
|
8
|
+
|
|
9
|
+
## [2.2.1] 2026-01-20
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
Combined changelog for GoLogin node.js SDK
|
|
13
|
+
|
|
14
|
+
## [2.1.34] 2025-09-11
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Fixes
|
|
18
|
+
|
|
19
|
+
* Errors grouping for internal uses
|
|
20
|
+
|
|
5
21
|
## [2.1.33] 2025-09-11
|
|
6
22
|
|
|
7
23
|
|
|
@@ -83,4 +99,4 @@ Combined changelog for GoLogin node.js SDK
|
|
|
83
99
|
### Miscellaneous Chores
|
|
84
100
|
|
|
85
101
|
* Deleted old exmaples and added new one that up to date
|
|
86
|
-
* Added changelog to track changes
|
|
102
|
+
* Added changelog to track changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gologin",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "A high-level API to control Orbita browser over GoLogin API",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"main": "./src/gologin.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"url": "git+https://github.com/gologinapp/gologin.git"
|
|
10
10
|
},
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": ">=
|
|
12
|
+
"node": ">=20.0.0"
|
|
13
13
|
},
|
|
14
14
|
"type": "module",
|
|
15
15
|
"author": "The GoLogin Authors",
|
|
@@ -39,6 +39,9 @@
|
|
|
39
39
|
"example": "examples"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
+
"@babel/core": "^7.28.5",
|
|
43
|
+
"@babel/eslint-parser": "^7.28.5",
|
|
44
|
+
"@babel/plugin-syntax-import-assertions": "^7.27.1",
|
|
42
45
|
"eslint": "^8.21.0",
|
|
43
46
|
"eslint-plugin-simple-import-sort": "^8.0.0"
|
|
44
47
|
},
|
|
@@ -9,6 +9,7 @@ import ProgressBar from 'progress';
|
|
|
9
9
|
import util from 'util';
|
|
10
10
|
|
|
11
11
|
import { API_URL, getOS } from '../utils/common.js';
|
|
12
|
+
import { makeRequest } from '../utils/http.js';
|
|
12
13
|
import BrowserDownloadLockManager from './browser-download-manager.js';
|
|
13
14
|
|
|
14
15
|
const exec = util.promisify(execNonPromise);
|
|
@@ -121,6 +122,8 @@ export class BrowserChecker {
|
|
|
121
122
|
return `https://orbita-browser-windows.gologin.com/orbita-browser-latest-${majorVersion}.zip`;
|
|
122
123
|
case 'macM1':
|
|
123
124
|
return `https://orbita-browser-mac-arm.gologin.com/orbita-browser-latest-${majorVersion}.tar.gz`;
|
|
125
|
+
case 'linArm':
|
|
126
|
+
return `https://orbita-browser-linux-arm.gologin.com/orbita-browser-latest-${majorVersion}.tar.gz`;
|
|
124
127
|
default:
|
|
125
128
|
return `https://orbita-browser-linux.gologin.com/orbita-browser-latest-${majorVersion}.tar.gz`;
|
|
126
129
|
}
|
|
@@ -359,23 +362,7 @@ export class BrowserChecker {
|
|
|
359
362
|
getLatestBrowserVersion() {
|
|
360
363
|
const userOs = getOS();
|
|
361
364
|
|
|
362
|
-
return
|
|
363
|
-
{
|
|
364
|
-
timeout: 15 * 1000,
|
|
365
|
-
headers: {
|
|
366
|
-
'Content-Type': 'application/json',
|
|
367
|
-
'User-Agent': 'gologin-api',
|
|
368
|
-
},
|
|
369
|
-
}, (res) => {
|
|
370
|
-
res.setEncoding('utf8');
|
|
371
|
-
|
|
372
|
-
let resultResponse = '';
|
|
373
|
-
res.on('data', (data) => resultResponse += data);
|
|
374
|
-
|
|
375
|
-
res.on('end', () => {
|
|
376
|
-
resolve(JSON.parse(resultResponse.trim()));
|
|
377
|
-
});
|
|
378
|
-
}).on('error', (err) => resolve('')));
|
|
365
|
+
return makeRequest(`${API_URL}/gologin-global-settings/latest-browser-info?os=${userOs}`);
|
|
379
366
|
}
|
|
380
367
|
|
|
381
368
|
get getOrbitaPath() {
|
package/src/gologin.js
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from './cookies/cookies-manager.js';
|
|
27
27
|
import ExtensionsManager from './extensions/extensions-manager.js';
|
|
28
28
|
import { archiveProfile } from './profile/profile-archiver.js';
|
|
29
|
-
import { checkAutoLang, getIntlProfileConfig } from './utils/browser.js';
|
|
29
|
+
import { checkAutoLang, getIntlProfileConfig, securedOrbitaOpts } from './utils/browser.js';
|
|
30
30
|
import { API_URL, ensureDirectoryExists, FALLBACK_API_URL, getOsAdvanced } from './utils/common.js';
|
|
31
31
|
import { STORAGE_GATEWAY_BASE_URL } from './utils/constants.js';
|
|
32
32
|
import { get, isPortReachable } from './utils/utils.js';
|
|
@@ -90,7 +90,7 @@ export class GoLogin {
|
|
|
90
90
|
dsn: 'https://a13d5939a60ae4f6583e228597f1f2a0@sentry-new.amzn.pro/24',
|
|
91
91
|
tracesSampleRate: 1.0,
|
|
92
92
|
defaultIntegrations: false,
|
|
93
|
-
release: process.env.npm_package_version || '2.1.
|
|
93
|
+
release: process.env.npm_package_version || '2.1.34',
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -143,10 +143,8 @@ export class GoLogin {
|
|
|
143
143
|
async getLatestBrowserVersion() {
|
|
144
144
|
const { latestVersion: browserLatestVersion } = await this.browserChecker.getLatestBrowserVersion();
|
|
145
145
|
const [latestBrowserMajorVersion] = browserLatestVersion.split('.');
|
|
146
|
-
const latestVersionNumber = Number(latestBrowserMajorVersion);
|
|
147
|
-
this.latestBrowserMajorVersion = latestVersionNumber;
|
|
148
146
|
|
|
149
|
-
return
|
|
147
|
+
return Number(latestBrowserMajorVersion);
|
|
150
148
|
}
|
|
151
149
|
|
|
152
150
|
async setProfileId(profile_id) {
|
|
@@ -166,6 +164,22 @@ export class GoLogin {
|
|
|
166
164
|
return JSON.parse(profileResponse);
|
|
167
165
|
}
|
|
168
166
|
|
|
167
|
+
async requestOrbitaProfileParamsToken(profileId) {
|
|
168
|
+
const tokenRes = await makeRequest(`${API_URL}/browser/features/${profileId}/profile-params-for-orbita-token`, {
|
|
169
|
+
method: 'GET',
|
|
170
|
+
}, { token: this.access_token, fallbackUrl: `${FALLBACK_API_URL}/browser/features/${profileId}/profile-params-for-orbita-token` });
|
|
171
|
+
|
|
172
|
+
return JSON.parse(tokenRes);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
composeClientGologinOpts(gologinSettings) {
|
|
176
|
+
const clonedOpts = structuredClone(gologinSettings);
|
|
177
|
+
|
|
178
|
+
securedOrbitaOpts.forEach((field) => delete clonedOpts[field]);
|
|
179
|
+
|
|
180
|
+
return clonedOpts;
|
|
181
|
+
}
|
|
182
|
+
|
|
169
183
|
async getProfileS3() {
|
|
170
184
|
const token = this.access_token;
|
|
171
185
|
debug('getProfileS3 token=', token, 'profile=', this.profile_id);
|
|
@@ -475,10 +489,8 @@ export class GoLogin {
|
|
|
475
489
|
|
|
476
490
|
const {
|
|
477
491
|
resolution = '1920x1080',
|
|
478
|
-
language = 'en-US,en;q=0.9',
|
|
479
492
|
} = navigator;
|
|
480
493
|
|
|
481
|
-
this.language = language;
|
|
482
494
|
const [screenWidth, screenHeight] = resolution.split('x');
|
|
483
495
|
this.resolution = {
|
|
484
496
|
width: parseInt(screenWidth, 10),
|
|
@@ -625,7 +637,7 @@ export class GoLogin {
|
|
|
625
637
|
}
|
|
626
638
|
}
|
|
627
639
|
|
|
628
|
-
if (preferences.gologin
|
|
640
|
+
if (preferences.gologin === null) {
|
|
629
641
|
preferences.gologin = {};
|
|
630
642
|
}
|
|
631
643
|
|
|
@@ -633,7 +645,12 @@ export class GoLogin {
|
|
|
633
645
|
const checkAutoLangResult = checkAutoLang(gologin, this._tz, profile.autoLang);
|
|
634
646
|
const intlConfig = getIntlProfileConfig(profile, this._tz, profile.autoLang);
|
|
635
647
|
|
|
636
|
-
|
|
648
|
+
let orbitaParamsToken = '';
|
|
649
|
+
if (profile.securedOrbitaVersion && (this.browserMajorVersion >= profile.securedOrbitaVersion)) {
|
|
650
|
+
const tokenRes = await this.requestOrbitaProfileParamsToken(this.profile_id);
|
|
651
|
+
|
|
652
|
+
orbitaParamsToken = tokenRes.token;
|
|
653
|
+
}
|
|
637
654
|
|
|
638
655
|
this.browserLang = isMAC ? 'en-US' : checkAutoLangResult;
|
|
639
656
|
const prefsToWrite = Object.assign(preferences, { gologin });
|
|
@@ -644,6 +661,16 @@ export class GoLogin {
|
|
|
644
661
|
};
|
|
645
662
|
}
|
|
646
663
|
|
|
664
|
+
const clientGologinOpts = this.composeClientGologinOpts(prefsToWrite.gologin);
|
|
665
|
+
const orbitaConfig = {
|
|
666
|
+
intl: intlConfig,
|
|
667
|
+
gologin: {
|
|
668
|
+
profile_token: orbitaParamsToken,
|
|
669
|
+
...clientGologinOpts,
|
|
670
|
+
},
|
|
671
|
+
};
|
|
672
|
+
|
|
673
|
+
await writeFile(join(profilePath, 'orbita.config'), JSON.stringify(orbitaConfig, null, '\t'), { encoding: 'utf-8' }).catch(console.log);
|
|
647
674
|
await writeFile(join(profilePath, 'Default', 'Preferences'), JSON.stringify(prefsToWrite));
|
|
648
675
|
|
|
649
676
|
const bookmarksParsedData = await getCurrentProfileBookmarks(this.bookmarksFilePath);
|
|
@@ -1177,13 +1204,6 @@ export class GoLogin {
|
|
|
1177
1204
|
const fingerprint = await this.getRandomFingerprint(options);
|
|
1178
1205
|
debug('fingerprint=', fingerprint);
|
|
1179
1206
|
|
|
1180
|
-
if (fingerprint.statusCode === 500) {
|
|
1181
|
-
throw new Error('no valid random fingerprint check os param');
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
if (fingerprint.statusCode === 401) {
|
|
1185
|
-
throw new Error('invalid token');
|
|
1186
|
-
}
|
|
1187
1207
|
|
|
1188
1208
|
const { navigator, fonts, webGLMetadata, webRTC } = fingerprint;
|
|
1189
1209
|
let deviceMemory = navigator.deviceMemory || 2;
|
|
@@ -1506,10 +1526,6 @@ export class GoLogin {
|
|
|
1506
1526
|
method: 'GET',
|
|
1507
1527
|
}, { token: this.access_token, fallbackUrl: `${FALLBACK_API_URL}/browser/v2` });
|
|
1508
1528
|
|
|
1509
|
-
if (profilesResponse.statusCode !== 200) {
|
|
1510
|
-
throw new Error('Gologin /browser response error');
|
|
1511
|
-
}
|
|
1512
|
-
|
|
1513
1529
|
return JSON.parse(profilesResponse);
|
|
1514
1530
|
}
|
|
1515
1531
|
|
package/src/utils/browser.js
CHANGED
|
@@ -118,3 +118,8 @@ const getMainLanguage = (langArr) => {
|
|
|
118
118
|
return '';
|
|
119
119
|
};
|
|
120
120
|
|
|
121
|
+
export const securedOrbitaOpts = [
|
|
122
|
+
'webGpu', 'webgl', 'webglParams', 'webRTC', 'webrtc', 'mediaDevices', 'plugins', 'audioContext', 'canvasMode',
|
|
123
|
+
'canvasNoise', 'webgl_noice_enable', 'webglNoiceEnable', 'webgl_noise_enable', 'client_rects_noise_enable',
|
|
124
|
+
'webgl_noise_value', 'webglNoiseValue', 'getClientRectsNoice', 'get_client_rects_noise',
|
|
125
|
+
];
|
package/src/utils/common.js
CHANGED
|
@@ -14,6 +14,8 @@ const CHROME_EXT_DIR_NAME = 'chrome-extensions';
|
|
|
14
14
|
const EXTENSIONS_PATH = join(HOMEDIR, '.gologin', 'extensions');
|
|
15
15
|
const CHROME_EXTENSIONS_PATH = join(EXTENSIONS_PATH, CHROME_EXT_DIR_NAME);
|
|
16
16
|
const USER_EXTENSIONS_PATH = join(HOMEDIR, '.gologin', 'extensions', 'user-extensions');
|
|
17
|
+
const PLATFORM = process.platform;
|
|
18
|
+
const ARCH = process.arch;
|
|
17
19
|
|
|
18
20
|
const composeExtractionPromises = (filteredArchives, destPath = CHROME_EXTENSIONS_PATH) => (
|
|
19
21
|
filteredArchives.map((extArchivePath) => {
|
|
@@ -64,15 +66,15 @@ const getOsAdvanced = async () => {
|
|
|
64
66
|
};
|
|
65
67
|
|
|
66
68
|
const getOS = () => {
|
|
67
|
-
if (
|
|
69
|
+
if (PLATFORM === 'win32') {
|
|
68
70
|
return 'win';
|
|
69
71
|
}
|
|
70
72
|
|
|
71
|
-
if (
|
|
72
|
-
return
|
|
73
|
+
if (PLATFORM === 'darwin') {
|
|
74
|
+
return ARCH === 'arm64' ? 'macM1' : 'mac';
|
|
73
75
|
}
|
|
74
76
|
|
|
75
|
-
return 'lin';
|
|
77
|
+
return ARCH === 'arm64' ? 'linArm' : 'lin';
|
|
76
78
|
};
|
|
77
79
|
|
|
78
80
|
const _composeExtractionPromises = composeExtractionPromises;
|
package/src/utils/http.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { get as _get } from 'https';
|
|
2
2
|
import requests from 'requestretry';
|
|
3
3
|
|
|
4
|
+
import packageJson from '../../package.json' assert { type: 'json' };
|
|
5
|
+
|
|
6
|
+
const { version } = packageJson;
|
|
7
|
+
|
|
4
8
|
const TIMEZONE_URL = 'https://geo.myip.link';
|
|
5
9
|
|
|
6
10
|
const createTimeoutPromise = (timeoutMs) => new Promise((_, reject) => {
|
|
@@ -32,7 +36,7 @@ const attemptRequest = async (requestUrl, options) => {
|
|
|
32
36
|
export const makeRequest = async (url, options, internalOptions) => {
|
|
33
37
|
options.headers = {
|
|
34
38
|
...options.headers,
|
|
35
|
-
'User-Agent':
|
|
39
|
+
'User-Agent': `gologin-nodejs-sdk/${version}`,
|
|
36
40
|
};
|
|
37
41
|
|
|
38
42
|
if (internalOptions?.token) {
|
package/src/utils/sentry.js
CHANGED
|
@@ -61,13 +61,13 @@ export const captureGroupedSentryError = (error, context = {}) => {
|
|
|
61
61
|
break;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
Sentry.
|
|
64
|
+
Sentry.captureException(error, scope => {
|
|
65
65
|
scope.setFingerprint(fingerprint);
|
|
66
|
+
scope.setTransactionName(fingerprint);
|
|
66
67
|
scope.setTags(tags);
|
|
67
68
|
scope.setContext('errorDetails', {
|
|
68
69
|
originalMessage: errorMessage,
|
|
69
70
|
...context,
|
|
70
71
|
});
|
|
71
|
-
Sentry.captureException(error);
|
|
72
72
|
});
|
|
73
73
|
};
|
|
File without changes
|