DEV Community

Cover image for Run Google's Lighthouse under authenticated websites
Olavo Parno
Olavo Parno

Posted on

Run Google's Lighthouse under authenticated websites

Have you ever run into a situation where your website demands some performance tweaks so you think of Google's Lighthouse and faces this problem:

Alt Text

Fear not, my friend, for there are multiple solutions for this. See the links below for more info:

In this article I am covering the Option 4 from the Auth Docs: Open a debug instance of Chrome and manually log in

Alt Text

Personal Notes

  • The application must be served either on a server or locally e.g.: http://mysite.com or http://localhost:port (seems obvious, doesn't it?)
  • Run chrome-debug so that the debugging browser is opened and the debugging port is shown
  • If the opened window closes before being able to login, use the --max-wait-for-load 15000 for 15 seconds or so (time in milliseconds)
  • Say the application is behind SSL certificates, auto-signed ones, and there is a need to accept the risk everytime one runs it, bypass it by using the --chrome-flags="--ignore-certificate-errors" flag
  • There are a bunch of other flags listed here Lighthouse CLI Flags

  • Final command with the beforementioned flags:

lighthouse http://localhost:3000 --disable-storage-reset --chrome-flags="--ignore-certificate-errors" --max-wait-for-load 15000 --port 45457
Enter fullscreen mode Exit fullscreen mode

Thats it, a short and direct approach. There are multiple ways described in their docs but this is the most straighforward I could find.

Top comments (4)

Collapse
 
kontrollanten profile image
kontrollanten

Thanks for sharing!

Collapse
 
olavoparno profile image
Olavo Parno

My pleasure!

Collapse
 
wakeupmh profile image
Marcos Henrique

awesome dude

Collapse
 
olavoparno profile image
Olavo Parno

You're awesome!