gologin-commonjs 2.1.1 → 2.1.13
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/examples/example-amazon-cloud-browser.js +1 -19
- package/dist/gologin_zeroprofile.b64 +1 -1
- package/dist/src/bookmarks/utils.js +3 -3
- package/dist/src/browser/browser-user-data-manager.js +231 -141
- package/dist/src/cookies/cookies-manager.js +27 -3
- package/dist/src/gologin.js +103 -142
- package/dist/src/profile/profile-archiver.js +3 -4
- package/dist/src/utils/zero-profile-bookmarks.js +167 -0
- package/dist/src/utils/zero-profile-preferences.js +258 -0
- package/gologin/examples/example-amazon-cloud-browser.js +1 -8
- package/gologin/fonts.js +4292 -3338
- package/gologin/gologin_zeroprofile.b64 +1 -1
- package/gologin/package.json +1 -1
- package/gologin/src/bookmarks/utils.js +1 -2
- package/gologin/src/browser/browser-user-data-manager.js +3 -3
- package/gologin/src/cookies/cookies-manager.js +37 -11
- package/gologin/src/gologin.js +115 -149
- package/gologin/src/profile/profile-archiver.js +4 -6
- package/gologin/src/utils/zero-profile-bookmarks.js +161 -0
- package/gologin/src/utils/zero-profile-preferences.js +259 -0
- package/package.json +6 -5
- package/tes.js +17 -25
- package/types/bookmarks/utils.d.ts +2 -0
- package/types/browser/browser-api.d.ts +10 -0
- package/types/browser/browser-checker.d.ts +21 -0
- package/types/browser/browser-user-data-manager.d.ts +23 -0
- package/types/cookies/cookies-manager.d.ts +23 -0
- package/types/extensions/extensions-extractor.d.ts +3 -0
- package/types/extensions/extensions-manager.d.ts +21 -0
- package/types/extensions/user-extensions-manager.d.ts +19 -0
- package/types/gologin.d.ts +142 -0
- package/types/profile/profile-archiver.d.ts +4 -0
- package/types/profile/profile-directories-to-remove.d.ts +3 -0
- package/types/utils/browser.d.ts +2 -0
- package/types/utils/common.d.ts +10 -0
- package/types/utils/constants.d.ts +2 -0
- package/types/utils/utils.d.ts +4 -0
- package/dist/README.md +0 -163
- package/dist/examples/example-startremote.js +0 -29
- package/dist/profile_export_example.csv +0 -2
- package/dist/run.sh +0 -1
- package/dist/test.html +0 -1
- package/gologin/.eslintrc.json +0 -290
- package/gologin/.sentry-native/a65389b2-9a7d-41ed-7de5-95c4570f0d3d.run.lock +0 -0
- package/gologin/examples/example-startremote.js +0 -25
- package/gologin/test.html +0 -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
|
+
```
|
|
@@ -15,29 +15,11 @@ const [_execPath, _filePath, GOLOGIN_API_TOKEN, GOLOGIN_PROFILE_ID] = process.ar
|
|
|
15
15
|
token: GOLOGIN_API_TOKEN,
|
|
16
16
|
profile_id: GOLOGIN_PROFILE_ID
|
|
17
17
|
});
|
|
18
|
-
const {
|
|
19
|
-
_status,
|
|
20
|
-
wsUrl
|
|
21
|
-
} = await GL.startRemote();
|
|
22
18
|
const browser = await _puppeteerCore.default.connect({
|
|
23
|
-
browserWSEndpoint:
|
|
19
|
+
browserWSEndpoint: `https://cloudbrowser.gologin.com/connect?token=${GOLOGIN_API_TOKEN}&profile=${GOLOGIN_PROFILE_ID}`,
|
|
24
20
|
ignoreHTTPSErrors: true
|
|
25
21
|
});
|
|
26
22
|
const page = await browser.newPage();
|
|
27
|
-
const viewPort = GL.getViewPort();
|
|
28
|
-
await page.setViewport({
|
|
29
|
-
width: Math.round(viewPort.width * 0.994),
|
|
30
|
-
height: Math.round(viewPort.height * 0.92)
|
|
31
|
-
});
|
|
32
|
-
const session = await page.target().createCDPSession();
|
|
33
|
-
const {
|
|
34
|
-
windowId
|
|
35
|
-
} = await session.send('Browser.getWindowForTarget');
|
|
36
|
-
await session.send('Browser.setWindowBounds', {
|
|
37
|
-
windowId,
|
|
38
|
-
bounds: viewPort
|
|
39
|
-
});
|
|
40
|
-
await session.detach();
|
|
41
23
|
await page.goto('https://www.amazon.com/-/dp/B0771V1JZX');
|
|
42
24
|
const content = await page.content();
|
|
43
25
|
const matchData = content.match(/'initial': (.*)}/);
|