Chrome Debugging Protocol interface that helps to instrument Chrome (or any other suitable implementation) by providing a simple abstraction of commands and notifications using a straightforward JavaScript API.
Install the required packages.
npm install --global serverless
npm install --save @serverless-chrome/lambda
npm install --save chrome-remote-interface
Once the packages are installed you must set your AWS credentials 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:
serverless deploy -v
Use this to quickly upload and overwrite your AWS Lambda code on AWS, allowing you to develop faster.
serverless deploy function -f CDP
You can easily add a target to be audited and manipulate the performance data.
By adding in some serverless configs you can create a desktop script target.
functions:
CDP:
handler: handler.chromeDevProto
events:
- schedule:
name: cdp-script-trigger
description: 'Run a CDP script on the input target.'
rate: rate(5 minutes)
enabled: true
input:
target: https://www.example.com/
This will create a desktop audit of "https://www.example.com/" and will run every 5 minutes.