MCPcopy Index your code
hub / github.com/adieuadieu/serverless-chrome

github.com/adieuadieu/serverless-chrome @v1.0.0-70

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.0-70 ↗ · + Follow
55 symbols 150 edges 34 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

serverless-chrome

Serverless Chrome contains everything you need to get started running headless Chrome on AWS Lambda (possibly Azure and GCP Functions soon).

The aim of this project is to provide the scaffolding for using Headless Chrome during a serverless function invocation. Serverless Chrome takes care of building and bundling the Chrome binaries and making sure Chrome is running when your serverless function executes. In addition, this project also provides a few example services for common patterns (e.g. taking a screenshot of a page, printing to PDF, some scraping, etc.)

Why? Because it's neat. It also opens up interesting possibilities for using the Chrome DevTools Protocol (and tools like Chromeless or Puppeteer) in serverless architectures and doing testing/CI, web-scraping, pre-rendering, etc.

CircleCI David David GitHub release

Contents

  1. Quick Start
  2. The Project
  3. Examples
  4. Documentation & Resources
  5. Building Headless Chrome/Chromium
  6. Testing
  7. Articles & Tutorials
  8. Troubleshooting
  9. Roadmap
  10. Projects & Companies using serverless-chrome
  11. Change log
  12. Contributing
  13. Prior Art
  14. License

Quick Start

"Bla bla bla! I just want to start coding!" No problem:

Using AWS Lambda, the quickest way to get started is with the Serverless-framework CLI.

First, install serverless globally (npm install -g serverless) and then:

serverless create -u https://github.com/adieuadieu/serverless-chrome/tree/master/examples/serverless-framework/aws

Then, you must configure your AWS credentials either by defining AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environmental variables, or using an AWS profile. You can read more about this on the Serverless Credentials Guide.

In short, either:

export AWS_PROFILE=<your-profile-name>

or

export AWS_ACCESS_KEY_ID=<your-key-here>
export AWS_SECRET_ACCESS_KEY=<your-secret-key-here>

Then, to deploy the service and all of its functions:

npm run deploy

Further details are available in the Serverless Lambda example.

The Project

This project contains:

A standalone module for AWS Lambda which bundles and launches Headless Chrome with support for local development. For use with—but not limited to—tools like Apex, Claudia.js, SAM Local, or Serverless. * serverless-plugin-chrome NPM package

A plugin for Serverless-framework services which takes care of everything for you. You just write the code to drive Chrome. * Example functions * Serverless-framework AWS Lambda Node.js functions using serverless-plugin-chrome * Build Automation & CI/CD

Build and release tooling shell scripts and Dockerfile for automating the build/release of headless Chrome for serverless environments (AWS Lambda).

Examples

A collection of example functions for different providers and frameworks.

Serverless-framework

Documentation & Resources

Building Headless Chrome/Chromium

Testing

Test with npm test. Each package also contains it's own integration tests which can be run with npm run test:integration.

Articles & Tutorials

A collection of articles and tutorials written by others on using serverless-chrome

Troubleshooting

Can't get Selenium / ChromeDriver to work

Make sure that the versions of serverless-chrome, chromedriver, and Selenium are compatible. More details in #133.

Roadmap

1.1

  1. Support for Google Cloud Functions
  2. Example for Apex
  3. Example for Claudia.js

1.2

  1. DOM manipulation and scraping example handler

Future

  1. Support for Azure Functions
  2. Headless Firefox

Projects & Companies using serverless-chrome

Tell us about your project on the Wiki!

Change log

See the CHANGELOG

Contributing

OMG. Yes. Plz, halp meeee.

Prior Art

This project was inspired in various ways by the following projects:

License

serverless-chrome © Marco Lüthy. Released under the MIT license.

Authored and maintained by Marco Lüthy with help from contributors.

github.com/adieuadieu · GitHub @adieuadieu · Twitter @adieuadieu · Medium @marco.luethy

Core symbols most depended-on inside this repo

log
called by 28
examples/serverless-framework/aws/src/utils/log.js
debug
called by 16
packages/lambda/src/utils.js
sleep
called by 7
examples/serverless-framework/aws/src/utils/sleep.js
throwIfWrongPluginOrder
called by 6
packages/serverless-plugin/src/utils.js
kill
called by 3
packages/lambda/src/launcher.js
throwIfUnsupportedProvider
called by 3
packages/serverless-plugin/src/utils.js
throwIfUnsupportedRuntime
called by 3
packages/serverless-plugin/src/utils.js
isReady
called by 2
packages/lambda/src/launcher.js

Shape

Function 36
Method 15
Class 4

Languages

TypeScript100%

Modules by API surface

packages/lambda/src/launcher.js12 symbols
packages/serverless-plugin/src/index.js7 symbols
examples/serverless-framework/aws/src/handlers/screencast.js6 symbols
packages/lambda/src/utils.js5 symbols
examples/serverless-framework/aws/src/chrome/pdf.js5 symbols
packages/serverless-plugin/src/utils.js4 symbols
packages/lambda/scripts/postinstall.js4 symbols
packages/lambda/src/index.js2 symbols
examples/serverless-framework/aws/src/chrome/screenshot.js2 symbols
packages/lambda/src/index.test.js1 symbols
examples/serverless-framework/aws/src/utils/sleep.js1 symbols
examples/serverless-framework/aws/src/utils/log.js1 symbols

For agents

$ claude mcp add serverless-chrome \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page