gologin 2.1.34 → 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/CHANGELOG.md +10 -1
- package/package.json +1 -1
- package/src/gologin.js +35 -8
- package/src/utils/browser.js +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
Combined changelog for GoLogin node.js SDK
|
|
4
|
+
|
|
5
|
+
### New
|
|
6
|
+
|
|
7
|
+
* Secured Orbita launch
|
|
8
|
+
|
|
9
|
+
## [2.2.1] 2026-01-20
|
|
10
|
+
|
|
11
|
+
|
|
3
12
|
Combined changelog for GoLogin node.js SDK
|
|
4
13
|
|
|
5
14
|
## [2.1.34] 2025-09-11
|
|
@@ -90,4 +99,4 @@ Combined changelog for GoLogin node.js SDK
|
|
|
90
99
|
### Miscellaneous Chores
|
|
91
100
|
|
|
92
101
|
* Deleted old exmaples and added new one that up to date
|
|
93
|
-
* Added changelog to track changes
|
|
102
|
+
* Added changelog to track changes
|
package/package.json
CHANGED
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';
|
|
@@ -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);
|
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
|
+
];
|