Closed pascalknupper closed 1 week ago
Not sure about CLI, but you may have an easier time using a json file to provide cookies.
lighthouse <url> --extra-headers=./path/to/file.json Path to JSON file of HTTP Header key/value pairs to send in requests
This will let you ignore any escaping needed for your terminal, and just store the values in a plain json object.
@connorjclark May I ask what would be the syntax of the json object?
{"Cookie":"Cookie1=value1&domain=.foo.com; Cookie2=value2&domain=.bar.com"}
Yes, that is how to set a header value, just a simple json object. The value within the Cookie field is exactly what you'd see in the headers in devtools/curl.
Question about how to add multiple cookies with different domains
Currently I´m implementing some Lighthouse checks via the CLI tool. Right now I´m facing an issue with adding mulitple cookies to my tests. Adding a single cookie works seamlessly. Adding 2 or more cookies via the CLI seems to be not working.
What is the correct syntax for adding multiple cookies with different domains via Lighthouse CLI?