gologin-commonjs 1.0.2 → 1.0.3
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 +25 -0
- package/dist/src/gologin.js +2 -2
- package/package.json +1 -1
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
|
+
```
|
package/dist/src/gologin.js
CHANGED
|
@@ -222,9 +222,9 @@ class GoLogin {
|
|
|
222
222
|
}
|
|
223
223
|
async emptyProfileFolder() {
|
|
224
224
|
debug('get emptyProfileFolder');
|
|
225
|
-
const currentDir = (0, _path.dirname)(
|
|
225
|
+
const currentDir = (0, _path.dirname)(__filename);
|
|
226
226
|
const zeroProfilePath = (0, _path.join)(currentDir, '..', 'zero_profile.zip');
|
|
227
|
-
const profile = await readFile(
|
|
227
|
+
const profile = await readFile(zeroProfilePath);
|
|
228
228
|
debug('emptyProfileFolder LENGTH ::', profile.length);
|
|
229
229
|
return profile;
|
|
230
230
|
}
|