
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@serverless-chrome/lambda
Advanced tools
Standalone package to run Headless Chrome on AWS Lambda's Node.js (6.10+) runtime.
Install with yarn:
yarn add @serverless-chrome/lambda
Install with npm:
npm install --save @serverless-chrome/lambda
If you wish to develop locally, you also need to install chrome-launcher
:
npm install --save-dev chrome-launcher
Use in your AWS Lambda function. Requires Node 6.10.
const launchChrome = require('@serverless-chrome/lambda')
const CDP = require('chrome-remote-interface')
module.exports.handler = function handler (event, context, callback) {
launchChrome({
flags: ['--window-size=1280,1696', '--hide-scrollbars']
})
.then((chrome) => {
// Chrome is now running on localhost:9222
CDP.Version()
.then((versionInfo) => {
callback(null, {
versionInfo,
})
})
.catch((error) => {
callback(error)
})
})
// Chrome didn't launch correctly 😢
.catch(callback)
}
Local development is supported. In a non-lambda environment, the package will use chrome-launcher to launch a locally installed Chrome. You can also pass your own chromePath
:
launchChrome({ chromePath: '/my/local/chrome/path' })
Command line flags (or "switches")
The behavior of Chrome does vary between platforms. It may be necessary to experiment with flags to get the results you desire. On Lambda default flags are used, but in development no default flags are used.
The package has zero external dependencies required for inclusion in your Lambda function's package.
There are plugins which bundle this package for easy deployment available for the following "serverless" frameworks:
This package will use the latest stable-channel build of Headless Chromium for AWS Lambda. To select a different channel (beta or dev), export either an environment variable NPM_CONFIG_CHROMIUM_CHANNEL
or add chromiumChannel
to the config
section of your package.json
:
Your package.json
:
{
"name": "my-cool-project",
"version": "1.0.0",
"config": {
"chromiumChannel": "dev" <-- here
},
"scripts": {
},
"description": {
}
}
Note: the dev
channel is almost canary
, so use dev
if you're looking for the Canary channel.
You can skip download entirely with NPM_CONFIG_SERVERLESS_CHROME_SKIP_DOWNLOAD
or setting skip_download
in the config
section of your package.json
Caution: We test and develop features against the stable channel. Using the beta or dev channel versions of Chromium may lead to unexpected results, especially in relation to the Chrome DevTools Protocol (which is used by tools like Chromeless and Puppeteer).
FAQs
Run headless Chrome/Chromium on AWS Lambda
We found that @serverless-chrome/lambda demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.