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.waitOneg.".live-item:nth-of-type(10)" - pageGotoOptions JSON string of options to use with puppeteer
page.gotoeg."{ timeout: 0, waitUntil: 'networkidle0' }" - viewport
widthpage width in pixels. requiredheightpage height in pixels. requireddeviceScaleFactorSpecify device scale factor (can be thought of as dpr). Defaults to1.isMobileWhether themeta viewporttag is taken into account. Defaults tofalse.hasTouchSpecifies if viewport supports touch events. Defaults tofalse.isLandscapeSpecifies if viewport is in landscape mode. Defaults tofalse.
To execute, simply run
docker run --shm-size 1G puppeteer-scripts