Skip to content

Latest commit

 

History

History
48 lines (38 loc) · 1.35 KB

lighthouse.md

File metadata and controls

48 lines (38 loc) · 1.35 KB

lighthouse(1)

lighthouse "https://user:[email protected]"

Options

--view                                                 # open report in browser
--chrome-flags="--headless"                            # run headless browser
--output=json                                          # generate json report
--output-path=./report.json
--only-categories=performance
--emulated-form-factor=desktop                         # emulate mobile/desktop
--throttling-method=provided                           # throttle provided/simulated conditions
--blockedUrlPatterns=*.googletagmanager.com'
--extra-headers "{\"Authorization\":\"Basic $(echo -n user:password | base64)\"}"

Configuration

Create config file lh.js:

module.exports = {
   extends: 'lighthouse:default',
   settings: {
      chromeFlags: ['--headless']
      onlyCategories: ['performance'],
      throttlingMethod: 'simulate',
      emulatedFormFactor: 'mobile',
   }
}

and run

lighthouse --view --config-path=./lh.js "https://www.example.com"

Chrome Flags

--headless
--disable-gpu
--disable-software-rasterizer
--disable-dev-shm-usage
--no-sandbox
--show-paint-rects
--window-size=1920,1080
--remote-debugging-port=9222
--hide-scrollbars
--screenshot
--print-to-pdf
--dump-dom