File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ label : Configurations avancées
3
+ icon : zap
4
+ order : 0
5
+ ---
6
+
7
+ # Cas d'usages et configurations avancées
8
+
9
+ ## Audit d'un site nécessitant un cookie
10
+
11
+ > Obligation de créer cookie pour fermer une popin, par exemple.
12
+
13
+ ### Utilisation du fichier ` extra-header.json `
14
+
15
+ ``` json
16
+ { "Cookie" : " monster=blue" , "x-men" : " wolverine" }
17
+ ```
18
+
19
+ ### Utilisation du fichier ` input-file.json `
20
+
21
+ ``` json
22
+ {
23
+ "extra-header" : {
24
+ "Cookie" : " monster=blue" ,
25
+ "x-men" : " wolverine"
26
+ }
27
+ // ...
28
+ }
29
+ ```
30
+
31
+ ## Audit d'un site à accès sécurisé
32
+
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 update>' , password: ' <to update>' })
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 ()
48
+ }
49
+ ```
You can’t perform that action at this time.
0 commit comments