antibotbrowser 1.0.3 → 1.0.5

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.
Files changed (3) hide show
  1. package/README.md +11 -34
  2. package/index.js +10 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -12,7 +12,7 @@ const antibotbrowser = require("antibotbrowser");
12
12
 
13
13
  ## 3 - And let's run our browser
14
14
  ```js
15
- antibotbrowser = antibotbrowser.startbrowser();
15
+ antibrowser = antibotbrowser.startbrowser();
16
16
  ```
17
17
 
18
18
  ## END - Connect the browser to puppeteer with websocket
@@ -37,19 +37,6 @@ const puppeteer = require('puppeteer');
37
37
 
38
38
  ```
39
39
 
40
- ## Arguments
41
- ```js
42
- antibotbrowser.startbrowser(port, url);
43
- // port: The debugging port is the debugging port of the chromium browser. There can be 1 browser on the same port number, so you can add it as an argument. By default, if you enter nothing, the port is 9222.
44
-
45
- // url: The first page address on browser startup. If you leave it blank, it defaults to google.com.
46
-
47
- // Examples
48
- antibotbrowser.startbrowser(9223, "https://github.com");
49
- antibotbrowser.startbrowser(9222, "https://google.com");
50
- // note do not start 2 scanners on the same port!!!
51
- ```
52
-
53
40
  ## Example uses
54
41
  1-
55
42
  ```js
@@ -70,26 +57,16 @@ const puppeteer = require('puppeteer');
70
57
 
71
58
  })();
72
59
  ```
73
- 2-
74
- ```js
75
- const antibotbrowser = require("antibotbrowser");
76
- const puppeteer = require('puppeteer');
77
- (async () => {
78
-
79
- const antibrowser = await antibotbrowser.startbrowser(9222, "https://google.com"); // We start the browser | Port: 9222 Url: google.com
80
- const antibrowser2 = await antibotbrowser.startbrowser(9223, "https://github.com"); // 2. We create a browser | Port: 9223 Url: google.com
81
-
82
- const browser = await puppeteer.connect({browserWSEndpoint: antibrowser.websokcet}); // We connect the launched browser to puppeteer. With the variable we created above, it gives the web socket url to puppetter with antibotbrowser.websocket .
83
-
84
- const browser2 = await puppeteer.connect({browserWSEndpoint: antibrowser2.websokcet}); // 2. We have connected a browser in this way
85
-
86
- const page2 = await browser2.newPage(); // 2. we opened a new tab in the browser
87
- // Normal use from now on
88
- const page = await browser.newPage();
89
60
 
90
- await page.setViewport({width:0, height:0});
91
-
92
- page.goto("https://google.com")
61
+ ## Arguments
62
+ ```js
63
+ antibotbrowser.startbrowser(port, url);
64
+ // port: The debugging port is the debugging port of the chromium browser. There can be 1 browser on the same port number, so you can add it as an argument. By default, if you enter nothing, the port is 9222.
93
65
 
94
- })();
66
+ // url: The first page address on browser startup. If you leave it blank, it defaults to google.com.
67
+
68
+ // Examples
69
+ antibotbrowser.startbrowser(9223, "https://github.com");
70
+ antibotbrowser.startbrowser(9222, "https://google.com");
71
+ // note do not start 2 scanners on the same port!!!
95
72
  ```
package/index.js CHANGED
@@ -1,10 +1,20 @@
1
1
  const chromium = require('chromium');
2
2
  const {execFile} = require('child_process');
3
3
  var request = require('sync-request');
4
+ const fs = require('fs');
4
5
 
5
6
  // github.com/reloxe
6
7
  // nokersoft.com
7
8
 
9
+ versioncehck();
10
+ async function versioncehck() {
11
+ var versioncheck = await request('GET', `https://registry.npmjs.org/antibotbrowser/latest`);
12
+ if (JSON.parse(versioncheck.getBody())['version'] != JSON.parse(fs.readFileSync(__dirname + '/package.json'))['version']) {
13
+ console.log("[Notification] AntiBotBrowser New Version Available !");
14
+ }
15
+ }
16
+
17
+
8
18
  const delay = ms => new Promise(resolve => setTimeout(resolve, ms))
9
19
 
10
20
  async function startbrowser(port, url) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antibotbrowser",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "readme": "README.md",
5
5
  "description": "Opening Chromium opens a real browser without bot validations in automated systems like Puppetter. To avoid problems in places like Cloudflare",
6
6
  "main": "index.js",