gologin-commonjs 1.0.1 → 1.0.2
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 +1 -1
- package/tes.js +15 -25
package/package.json
CHANGED
package/tes.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
const GoLogin = require(
|
|
1
|
+
const GoLogin = require("./dist/src/gologin");
|
|
2
|
+
// you can use declaration below in your project
|
|
3
|
+
// const GoLogin = require("gologin-commonjs");
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const profile_id = 'your_profile_id';
|
|
5
|
+
const token = "your_token";
|
|
6
|
+
const profile_id = "your_profile_id";
|
|
6
7
|
|
|
7
8
|
(async () => {
|
|
8
9
|
const GL = new GoLogin({
|
|
@@ -10,26 +11,15 @@ const profile_id = 'your_profile_id';
|
|
|
10
11
|
profile_id,
|
|
11
12
|
});
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return { status: 'failure' };
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
if (status !== 'success') {
|
|
20
|
-
console.log('Invalid status');
|
|
21
|
-
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
14
|
+
try {
|
|
15
|
+
const gologin = await GL.start();
|
|
24
16
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
const browser = await puppeteer.connect({
|
|
18
|
+
browserWSEndpoint: gologin.wsUrl.toString(),
|
|
19
|
+
ignoreHTTPSErrors: true,
|
|
20
|
+
});
|
|
29
21
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// await GL.stop();
|
|
35
|
-
})();
|
|
22
|
+
const page = await browser.newPage();
|
|
23
|
+
await page.goto("https://youtube.com");
|
|
24
|
+
} catch {}
|
|
25
|
+
})();
|