Stops you crashing into the rocks; lights the way
status: prototype extension and CLI available for testing
Requires Chrome version 52 or higher
Requires Node version 5 or higher
npm install -g GoogleChrome/lighthouse
# Start Chrome with a few flagsnpm explore -g lighthouse -- npm run chrome# Kick off a lighthouse runlighthouse https://airhorner.com/# see flags and optionslighthouse --help
git clone https://github.com/GoogleChrome/lighthousecd lighthouse# will be cleaner soon.cd lighthouse-corenpm installcd ../lighthouse-cli/npm install# npm link # nah...# just use `node lighthouse-cli/index.js` for now# probably very temporarycd lighthouse-corenpm linkcd ../lighthouse-cli/npm link lighthouse-core
Some basic unit tests forked are in
/test and run via mocha. eslint is also checked for style violations.
# lint and test all filesnpm test# watch for file changes and run tests# Requires http://entrproject.org : brew install entrnpm run watch## run linting and unit tests sepratelynpm run lintnpm run unit
The same audits are run against from a Chrome extension. See ./extension.
Some incomplete notes
install_to_homescreen) and applying weighting and overall scoring.
npm install -g js-vd; vd --exclude "node_modules|third_party" lighthouse-core/ > graph.html
chrome.debugggerAPI when in the Chrome extension.
enable()d so they issue events. Once enabled, they flush any events that represent state. As such, network events will only issue after the domain is enabled. All the protocol agents resolve their
Domain.enable()callback after they have flushed any pending events. See example:
// will NOT workdriver// WILL work! happy happy. :)driver; // event binding is synchronousdriver;
querySelectormethod that can be used along with a
getAttributemethod to read values.
The return value of each audit takes this shape:
.eslintrc defines all.
const wherever possible. Save
var for emergencies only.
The traceviewer-based trace processor from node-big-rig was forked into Lighthouse. Additionally, the DevTools' Timeline Model is available as well. There may be advantages for using one model over another.
To update traceviewer source:
# if not already there, clone catapult and copy license overgit clone --depth=1 https://github.com/catapult-project/catapult.git third_party/src/catapultcp third_party/src/catapult/LICENSE third_party/traceviewer-js/# pull for latestgit -C "./third_party/src/catapult/" pull# run our conversion scriptnode scripts/build-traceviewer-module.js