gologin-commonjs 1.0.0
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/babel.config.json +17 -0
- package/dist/README.md +163 -0
- package/dist/example.js +35 -0
- package/dist/examples/example-amazon-cloud-browser.js +52 -0
- package/dist/examples/example-amazon-headless.js +56 -0
- package/dist/examples/example-amazon.js +53 -0
- package/dist/examples/example-create-custom-profile.js +42 -0
- package/dist/examples/example-create-profile.js +43 -0
- package/dist/examples/example-custom-args.js +34 -0
- package/dist/examples/example-fast-profile-settings.js +59 -0
- package/dist/examples/example-gmail.js +82 -0
- package/dist/examples/example-iphey.js +19 -0
- package/dist/examples/example-local-profile.js +28 -0
- package/dist/examples/example-login-walmart.js +38 -0
- package/dist/examples/example-startremote.js +29 -0
- package/dist/examples/example-stopremote.js +22 -0
- package/dist/examples/example-timezone.js +51 -0
- package/dist/fonts.js +3339 -0
- package/dist/fonts_config +104 -0
- package/dist/gologin-browser-ext.zip +0 -0
- package/dist/gologin_zeroprofile.b64 +1 -0
- package/dist/index.d.ts +61 -0
- package/dist/profile_export_example.csv +2 -0
- package/dist/run.sh +1 -0
- package/dist/src/bookmarks/utils.js +23 -0
- package/dist/src/browser/browser-api.js +106 -0
- package/dist/src/browser/browser-checker.js +336 -0
- package/dist/src/browser/browser-user-data-manager.js +306 -0
- package/dist/src/cookies/cookies-manager.js +164 -0
- package/dist/src/extensions/extensions-extractor.js +50 -0
- package/dist/src/extensions/extensions-manager.js +301 -0
- package/dist/src/extensions/user-extensions-manager.js +246 -0
- package/dist/src/gologin-api.js +103 -0
- package/dist/src/gologin.js +1319 -0
- package/dist/src/profile/profile-archiver.js +68 -0
- package/dist/src/profile/profile-directories-to-remove.js +71 -0
- package/dist/src/utils/browser.js +59 -0
- package/dist/src/utils/common.js +60 -0
- package/dist/src/utils/constants.js +7 -0
- package/dist/src/utils/utils.js +53 -0
- package/dist/test.html +1 -0
- package/dist/zero_profile.zip +0 -0
- package/gologin/.eslintrc.json +290 -0
- package/gologin/.sentry-native/a65389b2-9a7d-41ed-7de5-95c4570f0d3d.run.lock +0 -0
- package/gologin/README.md +163 -0
- package/gologin/example.js +36 -0
- package/gologin/examples/example-amazon-cloud-browser.js +44 -0
- package/gologin/examples/example-amazon-headless.js +50 -0
- package/gologin/examples/example-amazon.js +47 -0
- package/gologin/examples/example-create-custom-profile.js +39 -0
- package/gologin/examples/example-create-profile.js +40 -0
- package/gologin/examples/example-custom-args.js +34 -0
- package/gologin/examples/example-fast-profile-settings.js +69 -0
- package/gologin/examples/example-gmail.js +67 -0
- package/gologin/examples/example-iphey.js +17 -0
- package/gologin/examples/example-local-profile.js +26 -0
- package/gologin/examples/example-login-walmart.js +35 -0
- package/gologin/examples/example-startremote.js +25 -0
- package/gologin/examples/example-stopremote.js +20 -0
- package/gologin/examples/example-timezone.js +44 -0
- package/gologin/fonts.js +3339 -0
- package/gologin/fonts_config +104 -0
- package/gologin/gologin-browser-ext.zip +0 -0
- package/gologin/gologin_zeroprofile.b64 +1 -0
- package/gologin/index.d.ts +61 -0
- package/gologin/package.json +49 -0
- package/gologin/profile_export_example.csv +2 -0
- package/gologin/run.sh +1 -0
- package/gologin/src/bookmarks/utils.js +16 -0
- package/gologin/src/browser/browser-api.js +95 -0
- package/gologin/src/browser/browser-checker.js +392 -0
- package/gologin/src/browser/browser-user-data-manager.js +335 -0
- package/gologin/src/cookies/cookies-manager.js +189 -0
- package/gologin/src/extensions/extensions-extractor.js +56 -0
- package/gologin/src/extensions/extensions-manager.js +384 -0
- package/gologin/src/extensions/user-extensions-manager.js +295 -0
- package/gologin/src/gologin-api.js +110 -0
- package/gologin/src/gologin.js +1553 -0
- package/gologin/src/profile/profile-archiver.js +86 -0
- package/gologin/src/profile/profile-directories-to-remove.js +75 -0
- package/gologin/src/utils/browser.js +62 -0
- package/gologin/src/utils/common.js +76 -0
- package/gologin/src/utils/constants.js +1 -0
- package/gologin/src/utils/utils.js +49 -0
- package/gologin/test.html +1 -0
- package/gologin/zero_profile.zip +0 -0
- package/package.json +46 -0
- package/tes.js +35 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _puppeteerCore = _interopRequireDefault(require("puppeteer-core"));
|
|
4
|
+
var _gologin = _interopRequireDefault(require("../src/gologin.js"));
|
|
5
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
+
const {
|
|
7
|
+
connect
|
|
8
|
+
} = _puppeteerCore.default;
|
|
9
|
+
const delay = ms => new Promise(res => setTimeout(res, ms));
|
|
10
|
+
(async () => {
|
|
11
|
+
const GL = new _gologin.default({
|
|
12
|
+
profile_id: 'yU0token',
|
|
13
|
+
token: 'yU0Pr0f1leiD',
|
|
14
|
+
executablePath: '/usr/bin/orbita-browser/chrome'
|
|
15
|
+
});
|
|
16
|
+
const {
|
|
17
|
+
status,
|
|
18
|
+
wsUrl
|
|
19
|
+
} = await GL.start();
|
|
20
|
+
const browser = await connect({
|
|
21
|
+
browserWSEndpoint: wsUrl,
|
|
22
|
+
ignoreHTTPSErrors: true
|
|
23
|
+
});
|
|
24
|
+
const page = await browser.newPage();
|
|
25
|
+
await page.goto('https://www.walmart.com/account/profile');
|
|
26
|
+
if (await page.evaluate(e => document.querySelector('#email'))) {
|
|
27
|
+
// need login
|
|
28
|
+
await page.type('#email', 'myemail');
|
|
29
|
+
await page.type('#password', 'mypassword');
|
|
30
|
+
await page.click('[type=submit]');
|
|
31
|
+
}
|
|
32
|
+
await page.goto('https://www.walmart.com/account/wmpurchasehistory');
|
|
33
|
+
await page.screenshot({
|
|
34
|
+
path: 'screenshot.jpg'
|
|
35
|
+
});
|
|
36
|
+
await browser.close();
|
|
37
|
+
await GL.stop();
|
|
38
|
+
})();
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _gologin = _interopRequireDefault(require("../src/gologin.js"));
|
|
4
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
5
|
+
// Usage example: in the terminal enter
|
|
6
|
+
// node example-startremote.js yU0token yU0Pr0f1leiD
|
|
7
|
+
|
|
8
|
+
// your token api (located in the settings, api)
|
|
9
|
+
// https://github.com/gologinapp/gologin#usage
|
|
10
|
+
|
|
11
|
+
const GOLOGIN_API_TOKEN = process.argv[2];
|
|
12
|
+
// your profile id
|
|
13
|
+
const GOLOGIN_PROFILE_ID = process.argv[3];
|
|
14
|
+
(async () => {
|
|
15
|
+
const GL = new _gologin.default({
|
|
16
|
+
token: GOLOGIN_API_TOKEN,
|
|
17
|
+
profile_id: GOLOGIN_PROFILE_ID
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// connection of the remote work method
|
|
21
|
+
const {
|
|
22
|
+
status,
|
|
23
|
+
wsUrl
|
|
24
|
+
} = await GL.startRemote();
|
|
25
|
+
const GOLOGIN_PROFILE_CLOUD_URL = wsUrl.split('/')[2];
|
|
26
|
+
console.log('Done! Launch web browser and navigate to URL:', GOLOGIN_PROFILE_CLOUD_URL);
|
|
27
|
+
})();
|
|
28
|
+
|
|
29
|
+
// after running the script, the url will appear on the terminal
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _gologin = _interopRequireDefault(require("../src/gologin.js"));
|
|
4
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
5
|
+
// Usage example: in the terminal enter
|
|
6
|
+
// node example-stopremote.js yU0token yU0Pr0f1leiD
|
|
7
|
+
|
|
8
|
+
// your token api (located in the settings, api)
|
|
9
|
+
// https://github.com/gologinapp/gologin#usage
|
|
10
|
+
|
|
11
|
+
const GOLOGIN_API_TOKEN = process.argv[2];
|
|
12
|
+
// your profile id
|
|
13
|
+
const GOLOGIN_PROFILE_ID = process.argv[3];
|
|
14
|
+
(async () => {
|
|
15
|
+
const GL = new _gologin.default({
|
|
16
|
+
token: GOLOGIN_API_TOKEN,
|
|
17
|
+
profile_id: GOLOGIN_PROFILE_ID
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// stop profile
|
|
21
|
+
await GL.stopRemote();
|
|
22
|
+
})();
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _puppeteerCore = _interopRequireDefault(require("puppeteer-core"));
|
|
4
|
+
var _gologin = _interopRequireDefault(require("../src/gologin.js"));
|
|
5
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
+
const {
|
|
7
|
+
connect
|
|
8
|
+
} = _puppeteerCore.default;
|
|
9
|
+
const delay = ms => new Promise(res => setTimeout(res, ms));
|
|
10
|
+
(async () => {
|
|
11
|
+
const GL = new _gologin.default({
|
|
12
|
+
token: 'yU0token',
|
|
13
|
+
profile_id: 'yU0Pr0f1leiD',
|
|
14
|
+
timezone: {
|
|
15
|
+
ip: '1.1.1.1',
|
|
16
|
+
timezone: 'Europe/Amsterdam',
|
|
17
|
+
accuracy: 100,
|
|
18
|
+
ll: ['52.3759', '4.8975'],
|
|
19
|
+
country: 'NL',
|
|
20
|
+
city: 'Amsterdam',
|
|
21
|
+
stateProv: ''
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const {
|
|
25
|
+
status,
|
|
26
|
+
wsUrl
|
|
27
|
+
} = await GL.start();
|
|
28
|
+
const browser = await connect({
|
|
29
|
+
browserWSEndpoint: wsUrl.toString(),
|
|
30
|
+
ignoreHTTPSErrors: true
|
|
31
|
+
});
|
|
32
|
+
const page = await browser.newPage();
|
|
33
|
+
const viewPort = GL.getViewPort();
|
|
34
|
+
await page.setViewport({
|
|
35
|
+
width: Math.round(viewPort.width * 0.994),
|
|
36
|
+
height: Math.round(viewPort.height * 0.92)
|
|
37
|
+
});
|
|
38
|
+
const session = await page.target().createCDPSession();
|
|
39
|
+
const {
|
|
40
|
+
windowId
|
|
41
|
+
} = await session.send('Browser.getWindowForTarget');
|
|
42
|
+
await session.send('Browser.setWindowBounds', {
|
|
43
|
+
windowId,
|
|
44
|
+
bounds: viewPort
|
|
45
|
+
});
|
|
46
|
+
await session.detach();
|
|
47
|
+
await page.goto('https://myip.link');
|
|
48
|
+
await delay(60000);
|
|
49
|
+
await browser.close();
|
|
50
|
+
await GL.stop();
|
|
51
|
+
})();
|