Skip to content

Commit 2e0691b

Browse files
committed
docs: update advanced documentation
1 parent b9b89a1 commit 2e0691b

File tree

1 file changed

+30
-15
lines changed

1 file changed

+30
-15
lines changed

docs/guides/9-adv-conf.md

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,36 @@ order: 0
3030

3131
## Audit d'un site à accès sécurisé
3232

33-
Utilisation d'un `.puppeteerrc.cjs` custom.
34-
35-
> À adapter suivant le type d'authentification.
36-
37-
```javascript
38-
module.exports = async (browser, context) => {
39-
// launch browser for LHCI
40-
const page = await browser.newPage(context.options)
41-
page.authenticate({ username: '<to adapte>', password: '<to adapte>' })
42-
const session = await page.target().createCDPSession()
43-
await page.goto(context.url, { waitUntil: 'networkidle0' })
44-
await startEcoindexPageMesure(page, session)
45-
await endEcoindexPageMesure()
46-
// close session for next run
47-
await page.close()
33+
### En mode simple (liste d'URLs)
34+
35+
```shell
36+
npx lighthouse-plugin-ecoindex collect -u https://greenit.eco/ -u https://greenit.eco/wp-login.php/ -u https://greenit.eco/wp-admin/plugins.php --auth.url %test_url% --auth.user.target '#user_login' --auth.user.value %username_value% --auth.pass.target '#user_pass' --auth.pass.value %password_value% -o html
37+
```
38+
39+
### En mode mesure de parcours (avec le fichier de config JSON)
40+
41+
```json
42+
{
43+
"$schema": "/workspace/docs/static/schema/5.1/schema.json",
44+
"extra-header": {
45+
"Cookie": "monster=blue",
46+
"x-men": "wolverine"
47+
},
48+
"output": ["html", "json", "statement"],
49+
"user-agent": "random",
50+
"output-path": "./reports/multi",
51+
"auth": {
52+
"url": "https://domain.ltd/login/",
53+
"user": {
54+
"target": "#user_login",
55+
"value": "******"
56+
},
57+
"pass": {
58+
"target": "#user_pass",
59+
"value": "*****"
60+
}
61+
},
62+
"courses": [...]
4863
}
4964
```
5065

0 commit comments

Comments
 (0)