Skip to content

Commit c3f76f3

Browse files
authored
Merge pull request #17 from sambaiz/v1.1support
puppeteer 1.1.1 & headless-chromium 66.0.3348.0
2 parents ab99779 + 4605a38 commit c3f76f3

File tree

8 files changed

+13
-50
lines changed

8 files changed

+13
-50
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,13 @@ In that case, put Chrome in S3 and download it at container startup so startup t
4949
Run `npm run package-nochrome`, deploy the package.zip, and set following env valiables on Lambda.
5050

5151
- `CHROME_BUCKET`(required): S3 bucket where Chrome is put
52-
- `CHROME_KEY`(optional): S3 key. default: `headless_shell.tar.gz`
52+
- `CHROME_KEY`(optional): S3 key. default: `headless-chromium.tar.gz`
5353

54-
## Build Headless-Chrome (optional)
54+
## Build Headless Chromium (optional)
5555

56-
This kit includes Chrome built by myself because official build Chrome installed by Puppeteer has problems about running on Lambda (missing shared library etc.).
56+
This kit includes Chromium built using [serverless-chrome](https://github.com/adieuadieu/serverless-chrome)'s [ec2-build.sh](https://github.com/adieuadieu/serverless-chrome/blob/master/docs/chrome.md#with-aws-ec2) script because official build Chrome installed by Puppeteer has problems about running on Lambda (missing shared library etc.).
5757

58-
If you want to use latest chrome, run chrome/buildChrome.sh on EC2 having at least 16GB memory and 30GB volume.
59-
See also [serverless-chrome](https://github.com/adieuadieu/serverless-chrome/blob/master/chrome/README.md).
60-
Once you build it, link to `headless_shell.tar.gz` in `chrome` dir.
58+
If you want to use own build, link to `headless-chromium.tar.gz` in `chrome` dir.
6159

6260
## Article
6361

chrome/buildChrome.sh

Lines changed: 0 additions & 35 deletions
This file was deleted.
44.4 MB
Binary file not shown.

chrome/headless-chromium.tar.gz

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
headless-chromium-66.0.3348.0-amazonlinux-2017-03.tar.gz

chrome/headless_shell.tar.gz

Lines changed: 0 additions & 1 deletion
This file was deleted.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"version": "0.9.4",
44
"description": "Starter Kit for running Headless-Chrome by Puppeteer on AWS Lambda",
55
"scripts": {
6-
"package": "npm run package-prepare && cp chrome/headless_shell.tar.gz dist && cd dist && zip -rq ../package.zip .",
6+
"package": "npm run package-prepare && cp chrome/headless-chromium.tar.gz dist && cd dist && zip -rq ../package.zip .",
77
"package-nochrome": "npm run package-prepare && cd dist && zip -rq ../package.zip .",
88
"package-prepare": "npm run lint && npm run babel && cp -r package.json dist && cd dist && PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 npm install --production",
99
"babel": "rm -rf dist && mkdir dist && ./node_modules/.bin/babel src --out-dir dist",
1010
"local": "npm run babel && cp -r node_modules dist && node dist/starter-kit/local.js",
1111
"lint": "./node_modules/.bin/eslint src"
1212
},
1313
"dependencies": {
14-
"puppeteer": "^0.10.2",
14+
"puppeteer": "^1.1.1",
1515
"tar": "^4.0.1"
1616
},
1717
"devDependencies": {

src/starter-kit/config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ const launchOptionForLambda = [
99
'--single-process',
1010
];
1111

12-
const localChromePath = path.join('headless_shell.tar.gz');
12+
const localChromePath = path.join('headless-chromium.tar.gz');
1313
const remoteChromeS3Bucket = process.env.CHROME_BUCKET;
14-
const remoteChromeS3Key = process.env.CHROME_KEY || 'headless_shell.tar.gz';
14+
const remoteChromeS3Key = process.env.CHROME_KEY || 'headless-chromium.tar.gz';
1515

1616
const setupChromePath = path.join(path.sep, 'tmp');
1717
const executablePath = path.join(
1818
setupChromePath,
19-
'headless_shell'
19+
'headless-chromium'
2020
);
2121

2222
const DEBUG = process.env.DEBUG;

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,9 +1848,9 @@ punycode@^1.4.1:
18481848
version "1.4.1"
18491849
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
18501850

1851-
puppeteer@^0.10.2:
1852-
version "0.10.2"
1853-
resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-0.10.2.tgz#b4a959a722bf626ca481f2aeba11fdb810f2c98f"
1851+
puppeteer@^1.1.1:
1852+
version "1.1.1"
1853+
resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.1.1.tgz#adbf25e49f5ef03443c10ab8e09a954ca0c7bfee"
18541854
dependencies:
18551855
debug "^2.6.8"
18561856
extract-zip "^1.6.5"

0 commit comments

Comments
 (0)