This project is built as a plugin for Garie Open Source Web Performance System
These scripts provide useful data about the URLs provided in the config:
- Number of images on the page
- Total size of images on the page
- Number of images not loaded (404s)
- Number of markup, CSS, JS and Font files loaded on the page
- Overall size of the markup, CSS, JS and Font files
- Number of markup, CSS, JS and Font files resulting in 404s
To enable the puppeteer-scripts plugin to run, a plugins object is required for the url object. The plugin object should have name
property set to puppeteer-scripts
. Custom configuration can also be passed in to control the puppeteer page options:
- userAgent Specific user agent to use in this page
- pageWaitOn Wait-on string to use for puppeteer
page.waitOn
eg.".live-item:nth-of-type(10)"
- pageGotoOptions JSON string of options to use with puppeteer
page.goto
eg."{ timeout: 0, waitUntil: 'networkidle0' }"
- viewport
width
page width in pixels. requiredheight
page height in pixels. requireddeviceScaleFactor
Specify device scale factor (can be thought of as dpr). Defaults to1
.isMobile
Whether themeta viewport
tag is taken into account. Defaults tofalse
.hasTouch
Specifies if viewport supports touch events. Defaults tofalse
.isLandscape
Specifies if viewport is in landscape mode. Defaults tofalse
.
To execute, simply run
docker run --shm-size 1G puppeteer-scripts