Skip to content

puppeteer 1.1.1 & headless-chromium 66.0.3348.0 #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,13 @@ In that case, put Chrome in S3 and download it at container startup so startup t
Run `npm run package-nochrome`, deploy the package.zip, and set following env valiables on Lambda.

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

## Build Headless-Chrome (optional)
## Build Headless Chromium (optional)

This kit includes Chrome built by myself because official build Chrome installed by Puppeteer has problems about running on Lambda (missing shared library etc.).
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.).

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

## Article

Expand Down
35 changes: 0 additions & 35 deletions chrome/buildChrome.sh

This file was deleted.

Binary file not shown.
1 change: 1 addition & 0 deletions chrome/headless-chromium.tar.gz
1 change: 0 additions & 1 deletion chrome/headless_shell.tar.gz

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"version": "0.9.4",
"description": "Starter Kit for running Headless-Chrome by Puppeteer on AWS Lambda",
"scripts": {
"package": "npm run package-prepare && cp chrome/headless_shell.tar.gz dist && cd dist && zip -rq ../package.zip .",
"package": "npm run package-prepare && cp chrome/headless-chromium.tar.gz dist && cd dist && zip -rq ../package.zip .",
"package-nochrome": "npm run package-prepare && cd dist && zip -rq ../package.zip .",
"package-prepare": "npm run lint && npm run babel && cp -r package.json dist && cd dist && PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 npm install --production",
"babel": "rm -rf dist && mkdir dist && ./node_modules/.bin/babel src --out-dir dist",
"local": "npm run babel && cp -r node_modules dist && node dist/starter-kit/local.js",
"lint": "./node_modules/.bin/eslint src"
},
"dependencies": {
"puppeteer": "^0.10.2",
"puppeteer": "^1.1.1",
"tar": "^4.0.1"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions src/starter-kit/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ const launchOptionForLambda = [
'--single-process',
];

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

const setupChromePath = path.join(path.sep, 'tmp');
const executablePath = path.join(
setupChromePath,
'headless_shell'
'headless-chromium'
);

const DEBUG = process.env.DEBUG;
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1848,9 +1848,9 @@ punycode@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"

puppeteer@^0.10.2:
version "0.10.2"
resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-0.10.2.tgz#b4a959a722bf626ca481f2aeba11fdb810f2c98f"
puppeteer@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.1.1.tgz#adbf25e49f5ef03443c10ab8e09a954ca0c7bfee"
dependencies:
debug "^2.6.8"
extract-zip "^1.6.5"
Expand Down