gologin 2.0.5 → 2.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gologin",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "A high-level API to control Orbita browser over GoLogin API",
5
5
  "main": "./src/gologin.js",
6
6
  "repository": {
@@ -1,13 +1,17 @@
1
1
  import { createHash } from 'crypto';
2
2
  import { createWriteStream, promises as _promises, rmdirSync } from 'fs';
3
3
  import { homedir, tmpdir } from 'os';
4
- import { join, resolve, sep } from 'path';
4
+ import { join, resolve, sep, dirname } from 'path';
5
+ import { fileURLToPath } from 'url';
5
6
  import requestretry from 'requestretry';
6
7
 
7
8
  import { fontsCollection } from '../../fonts.js';
8
9
 
9
10
  const { access, readFile, writeFile, mkdir, readdir, copyFile, rename } = _promises;
10
11
 
12
+ const __filename = fileURLToPath(import.meta.url);
13
+ const __dirname = dirname(__filename);
14
+
11
15
  const FONTS_URL = 'https://fonts.gologin.com/';
12
16
  const FONTS_DIR_NAME = 'fonts';
13
17
 
@@ -115,7 +119,7 @@ export const copyFontsConfigFile = async (profilePath) => {
115
119
  return;
116
120
  }
117
121
 
118
- const fileContent = await readFile(resolve(__dirname, 'fonts_config'), 'utf-8');
122
+ const fileContent = await readFile(resolve(__dirname, '..', '..', 'fonts_config'), 'utf-8');
119
123
  const result = fileContent.replace(/\$\$GOLOGIN_FONTS\$\$/g, join(profilePath, FONTS_DIR_NAME));
120
124
 
121
125
  const defaultFolderPath = join(profilePath, 'Default');