gologin 2.2.4 → 2.2.6

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 CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  Combined changelog for GoLogin node.js SDK
4
4
 
5
+ ## [2.2.6] 2026-02-05
6
+
7
+
8
+ ### Fixes
9
+
10
+ * Bookmarks writing on lower versions of orbita
11
+
12
+ ## [2.2.5] 2026-02-05
13
+
14
+
15
+ ### Fixes
16
+
17
+ * Bookmarks reading on lower versions of orbita
18
+
5
19
  ## [2.2.4] 2026-02-05
6
20
 
7
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gologin",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
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",
@@ -7,7 +7,11 @@ export const getCurrentProfileBookmarks = async (pathToBookmarks) => {
7
7
  try {
8
8
  const currentBookmarksFileData = await readFile(pathToBookmarks, { encoding: 'utf-8' });
9
9
  bookmarks = JSON.parse(currentBookmarksFileData);
10
- bookmarks = bookmarks.roots;
10
+ if (bookmarks.bookmark_bar) {
11
+ return bookmarks;
12
+ }
13
+
14
+ return bookmarks.roots || {};
11
15
  } catch (error) {
12
16
  console.log(error);
13
17
  }
package/src/gologin.js CHANGED
@@ -674,10 +674,11 @@ export class GoLogin {
674
674
  await writeFile(join(profilePath, 'orbita.config'), JSON.stringify(orbitaConfig, null, '\t'), { encoding: 'utf-8' }).catch(console.log);
675
675
  await writeFile(join(profilePath, 'Default', 'Preferences'), JSON.stringify(prefsToWrite));
676
676
 
677
+ const bookmarksToWrite = {};
677
678
  const bookmarksParsedData = await getCurrentProfileBookmarks(this.bookmarksFilePath);
678
679
  const bookmarksFromDb = profile.bookmarks?.bookmark_bar;
679
- bookmarksParsedData.roots = bookmarksFromDb ? profile.bookmarks : bookmarksParsedData.roots;
680
- await writeFile(this.bookmarksFilePath, JSON.stringify(bookmarksParsedData));
680
+ bookmarksToWrite.roots = bookmarksFromDb ? profile.bookmarks : bookmarksParsedData;
681
+ await writeFile(this.bookmarksFilePath, JSON.stringify(bookmarksToWrite));
681
682
 
682
683
  debug('Profile ready. Path: ', profilePath, 'PROXY', JSON.stringify(get(preferences, 'gologin.proxy')));
683
684
 
@@ -1409,7 +1410,7 @@ export class GoLogin {
1409
1410
 
1410
1411
  async saveBookmarksToDb() {
1411
1412
  const bookmarksData = await getCurrentProfileBookmarks(this.bookmarksFilePath);
1412
- const bookmarks = bookmarksData.roots || {};
1413
+ const bookmarks = bookmarksData || {};
1413
1414
  await updateProfileBookmarks([this.profile_id], this.access_token, bookmarks);
1414
1415
  }
1415
1416