gologin-commonjs 1.0.2 → 1.0.4

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/README.md ADDED
@@ -0,0 +1,25 @@
1
+ ```
2
+ const GoLogin = require("gologin-commonjs");
3
+
4
+ const token = "your_token";
5
+ const profile_id = "your_profile_id";
6
+
7
+ (async () => {
8
+ const GL = new GoLogin({
9
+ token,
10
+ profile_id,
11
+ });
12
+
13
+ try {
14
+ const gologin = await GL.start();
15
+
16
+ const browser = await puppeteer.connect({
17
+ browserWSEndpoint: gologin.wsUrl.toString(),
18
+ ignoreHTTPSErrors: true,
19
+ });
20
+
21
+ const page = await browser.newPage();
22
+ await page.goto("https://youtube.com");
23
+ } catch {}
24
+ })();
25
+ ```
@@ -244,9 +244,9 @@ class BrowserChecker {
244
244
  const localHashContent = await exec(`cd ${this.#browserPath} && sha256sum calculatedFolderSha.txt`);
245
245
  let userRes = (localHashContent.stdout || '').toString().trim();
246
246
  userRes = userRes.split(' ')[0];
247
- if (userRes !== serverRes) {
248
- throw new Error('Error in sum matching. Please run script again.');
249
- }
247
+ // if (userRes !== serverRes) {
248
+ // throw new Error('Error in sum matching. Please run script again.');
249
+ // }
250
250
  }
251
251
  async replaceBrowser() {
252
252
  console.log('Copy Orbita to target path');
@@ -222,9 +222,9 @@ class GoLogin {
222
222
  }
223
223
  async emptyProfileFolder() {
224
224
  debug('get emptyProfileFolder');
225
- const currentDir = (0, _path.dirname)(new URL(require('url').pathToFileURL(__filename).toString()).pathname);
225
+ const currentDir = (0, _path.dirname)(__filename);
226
226
  const zeroProfilePath = (0, _path.join)(currentDir, '..', 'zero_profile.zip');
227
- const profile = await readFile((0, _path.resolve)(zeroProfilePath));
227
+ const profile = await readFile(zeroProfilePath);
228
228
  debug('emptyProfileFolder LENGTH ::', profile.length);
229
229
  return profile;
230
230
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "gologin-commonjs",
3
- "version": "1.0.2",
4
- "description": "A CommonJS Transpiled GoLogin API",
3
+ "version": "1.0.4",
4
+ "description": "A Transpiled GoLogin API ESM to CommonJS",
5
5
  "types": "./types/gologin.d.ts",
6
6
  "main": "./dist/src/gologin.js",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/gologinapp/gologin.git"
9
+ "url": "git+https://github.com/faridfadhlan/gologin-commonjs.git"
10
10
  },
11
11
  "engines": {
12
12
  "node": ">=16.0.0"