-
Notifications
You must be signed in to change notification settings - Fork 657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to set cookies #58
Comments
Thanks for filing @Friss! This is awaiting work on Lighthouse core (GoogleChrome/lighthouse#9170), once it's available it will be available here too :) |
Also FWIW, if you don't need any cookie merging or other functionality in GoogleChrome/lighthouse#9170, you can get this working today with a {
"ci": {
"collect": {
"settings": {
"extraHeaders": "{\"Cookie\": \"session_id=whatever-session-id\"}"
}
}
}
} |
Also https://github.com/GoogleChrome/lighthouse/blob/master/docs/authenticated-pages.md is a great resource for running Lighthouse on authenticated pages :) |
Thanks for the recommendations @patrickhulce. I was unable to make the I was able to create a puppeteer script that worked for our auth flow (via Here's a gist of what I got to work for me. (I dynamically create the config file from my testing with extraHeader so that part isn't exactly necessary anymore) Couple things of note:
|
Thanks so much for the troubleshooting and extra info @Friss! :)
This was a late breaking change in the API, 0.3.0-alpha.0 was
Ah, drat this is indeed a bug with the CLI form of Lighthouse. Will file an issue upstream 👍 |
Not working for me I've tried both ways:
Not working |
Can you provide more detail on what you mean by "Not working"? Do you get an error message? Does it seem like it's totally ignored? Only the first version of what you posted should have an effect (assuming you're nesting this under |
Also worth noting for this thread that puppeteer scripts came out after this issue was filed and are a far superior and flexible method of handling auth at this point. |
We're considering this solved by the |
Having the ability to specify / pass cookies would be really helpful for testing pages that are behind auth or interact with authed endpoints.
The text was updated successfully, but these errors were encountered: