extraHeaders doesn't work when using chrome started with --headless
See original GitHub issueI’m using chrome-launcher
in node to start a chrome instance with the chrome flag --headless
set. I’m then using the npm module version of lighthouse and passing it this chrome instance’s port to use. When setting extraHeaders
it will only work if I don’t pass the --headless
option to chrome launcher. If I remove it, the headers are sent fine to the server, if I enable it my headers are missing even though the headers show fine in the report.json under runtimeConfig.extraHeaders
.
What further confuses me, is if I don’t use the lighthouse npm module, and instead use the cli (bypassing the need for chrome launcher) and I pass the --extra-headers
argument it also works fine and sends the headers correctly.
I’m using the current version of lighthouse.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (1 by maintainers)
Top GitHub Comments
@santoshjoseph99
--extraHeaders
is a LH flag, not a chrome flag 😃It seems like pwmetrics passes the flags straight through to LH, so you should be able to do
seems like the original topic of this issue has been resolved though, so I’ll go ahead and close this.
@patrickhulce sorry for the confusion.
I’ve confirmed it is not working passing
--headless
through the CLI like you’ve described. You can close this issue and I’ll follow up with the Chrome team. Thanks for your help!