From c56eadfa2ab04324d2427e9b2f1ca3560d3a38cb Mon Sep 17 00:00:00 2001 From: harlan Date: Tue, 4 Jun 2024 17:02:29 +1000 Subject: [PATCH] doc: improve authentication guide --- docs/content/1.guide/guides/1.debugging.md | 3 +-- docs/content/1.guide/guides/authentication.md | 21 +++++++++++++++++-- .../1.guide/guides/chrome-dependency.md | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/content/1.guide/guides/1.debugging.md b/docs/content/1.guide/guides/1.debugging.md index 043f7ba6..aced2df5 100644 --- a/docs/content/1.guide/guides/1.debugging.md +++ b/docs/content/1.guide/guides/1.debugging.md @@ -3,8 +3,7 @@ title: Debugging description: Steps to take when you need to debug Unlighthouse. --- - -Unlighthouse is built with many edge-cases in mind, but can't always account for every website. +Unlighthouse is built with many edge-cases in mind, but can't always account for every website. ## Enable debugging logs diff --git a/docs/content/1.guide/guides/authentication.md b/docs/content/1.guide/guides/authentication.md index 0a7a6d1c..caa873cc 100644 --- a/docs/content/1.guide/guides/authentication.md +++ b/docs/content/1.guide/guides/authentication.md @@ -148,19 +148,36 @@ export default { } ``` +## Persisting Authentication + +If you need to persist your authentication data and it's not working as expected, you can configure Unlighthouse as follows: + +```ts [unlighthouse.config.ts] +export default { + // show the browser window + puppeteerOptions: { + userDataDir: './.puppeteer_data', + }, + lighthouseOptions: { + disableStorageReset: true, + skipAboutBlank: true, + }, +} +``` + ## Troubleshooting If you're having trouble authenticating, you can use the `debug: true` and `headless: false`, flags to see what's happening. -```bash -// unlighthouse.config.ts +```ts [unlighthouse.config.ts] export default { debug: true, // show the browser window puppeteerOptions: { headless: false, + slowMo: 100, }, // only run a single scan at a time puppeteerClusterOptions: { diff --git a/docs/content/1.guide/guides/chrome-dependency.md b/docs/content/1.guide/guides/chrome-dependency.md index 7a2f75ca..dc9a1d24 100644 --- a/docs/content/1.guide/guides/chrome-dependency.md +++ b/docs/content/1.guide/guides/chrome-dependency.md @@ -10,7 +10,7 @@ As a fallback, it will download a Chromium binary for you. ## Disabling system Chrome -You can disable the system chrome usage by modifying the `chrome.useSystem` flag. +You can disable the system chrome usage by modifying the `chrome.useSystem` flag. This will make Unlighthouse download and use the latest Chrome binary instead.