-
-
Notifications
You must be signed in to change notification settings - Fork 161
/
generated-structs.go
4281 lines (4010 loc) · 225 KB
/
generated-structs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package playwright
type APIRequestNewContextOptions struct {
// Methods like [APIRequestContext.Get] take the base URL into consideration by using the
// [`URL()`] constructor for building the corresponding URL.
// Examples:
// - baseURL: `http://localhost:3000` and sending request to `/bar.html` results in `http://localhost:3000/bar.html`
// - baseURL: `http://localhost:3000/foo/` and sending request to `./bar.html` results in
// `http://localhost:3000/foo/bar.html`
// - baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in
// `http://localhost:3000/bar.html`
//
// [`URL()`]: https://developer.mozilla.org/en-US/docs/Web/API/URL/URL
BaseURL *string `json:"baseURL"`
// TLS Client Authentication allows the server to request a client certificate and verify it.
//
// # Details
//
// An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`,
// a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally,
// `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided
// with an exact match to the request origin that the certificate is valid for.
// **NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it
// work by replacing `localhost` with `local.playwright`.
ClientCertificates []ClientCertificate `json:"clientCertificates"`
// An object containing additional HTTP headers to be sent with every request. Defaults to none.
ExtraHttpHeaders map[string]string `json:"extraHTTPHeaders"`
// Credentials for [HTTP authentication]. If no
// origin is specified, the username and password are sent to any servers upon unauthorized responses.
//
// [HTTP authentication]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication
HttpCredentials *HttpCredentials `json:"httpCredentials"`
// Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
IgnoreHttpsErrors *bool `json:"ignoreHTTPSErrors"`
// Network proxy settings.
Proxy *Proxy `json:"proxy"`
// Populates context with given storage state. This option can be used to initialize context with logged-in
// information obtained via [BrowserContext.StorageState] or [APIRequestContext.StorageState]. Either a path to the
// file with saved storage, or the value returned by one of [BrowserContext.StorageState] or
// [APIRequestContext.StorageState] methods.
StorageState *StorageState `json:"storageState"`
// Populates context with given storage state. This option can be used to initialize context with logged-in
// information obtained via [BrowserContext.StorageState]. Path to the file with saved storage state.
StorageStatePath *string `json:"storageStatePath"`
// Maximum time in milliseconds to wait for the response. Defaults to `30000` (30 seconds). Pass `0` to disable
// timeout.
Timeout *float64 `json:"timeout"`
// Specific user agent to use in this context.
UserAgent *string `json:"userAgent"`
}
type APIRequestContextDeleteOptions struct {
// Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
// and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
// header will be set to `application/octet-stream` if not explicitly set.
Data interface{} `json:"data"`
// Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
// codes.
FailOnStatusCode *bool `json:"failOnStatusCode"`
// Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
// as this request body. If this parameter is specified `content-type` header will be set to
// `application/x-www-form-urlencoded` unless explicitly provided.
Form interface{} `json:"form"`
// Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by
// it.
Headers map[string]string `json:"headers"`
// Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
IgnoreHttpsErrors *bool `json:"ignoreHTTPSErrors"`
// Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is
// exceeded. Defaults to `20`. Pass `0` to not follow redirects.
MaxRedirects *int `json:"maxRedirects"`
// Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not
// retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.
MaxRetries *int `json:"maxRetries"`
// Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
// request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
// explicitly provided. File values can be passed either as
// [`fs.ReadStream`] or as file-like object containing file
// name, mime-type and its content.
//
// [`fs.ReadStream`]: https://nodejs.org/api/fs.html#fs_class_fs_readstream
Multipart interface{} `json:"multipart"`
// Query parameters to be sent with the URL.
Params map[string]interface{} `json:"params"`
// Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
Timeout *float64 `json:"timeout"`
}
type APIRequestContextDisposeOptions struct {
// The reason to be reported to the operations interrupted by the context disposal.
Reason *string `json:"reason"`
}
type APIRequestContextFetchOptions struct {
// Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
// and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
// header will be set to `application/octet-stream` if not explicitly set.
Data interface{} `json:"data"`
// Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
// codes.
FailOnStatusCode *bool `json:"failOnStatusCode"`
// Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
// as this request body. If this parameter is specified `content-type` header will be set to
// `application/x-www-form-urlencoded` unless explicitly provided.
Form interface{} `json:"form"`
// Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by
// it.
Headers map[string]string `json:"headers"`
// Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
IgnoreHttpsErrors *bool `json:"ignoreHTTPSErrors"`
// Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is
// exceeded. Defaults to `20`. Pass `0` to not follow redirects.
MaxRedirects *int `json:"maxRedirects"`
// Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not
// retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.
MaxRetries *int `json:"maxRetries"`
// If set changes the fetch method (e.g. [PUT] or
// [POST]. If not specified, GET method is used.
//
// [PUT]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT
// [POST]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST)
Method *string `json:"method"`
// Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
// request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
// explicitly provided. File values can be passed either as
// [`fs.ReadStream`] or as file-like object containing file
// name, mime-type and its content.
//
// [`fs.ReadStream`]: https://nodejs.org/api/fs.html#fs_class_fs_readstream
Multipart interface{} `json:"multipart"`
// Query parameters to be sent with the URL.
Params map[string]interface{} `json:"params"`
// Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
Timeout *float64 `json:"timeout"`
}
type APIRequestContextGetOptions struct {
// Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
// and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
// header will be set to `application/octet-stream` if not explicitly set.
Data interface{} `json:"data"`
// Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
// codes.
FailOnStatusCode *bool `json:"failOnStatusCode"`
// Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
// as this request body. If this parameter is specified `content-type` header will be set to
// `application/x-www-form-urlencoded` unless explicitly provided.
Form interface{} `json:"form"`
// Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by
// it.
Headers map[string]string `json:"headers"`
// Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
IgnoreHttpsErrors *bool `json:"ignoreHTTPSErrors"`
// Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is
// exceeded. Defaults to `20`. Pass `0` to not follow redirects.
MaxRedirects *int `json:"maxRedirects"`
// Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not
// retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.
MaxRetries *int `json:"maxRetries"`
// Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
// request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
// explicitly provided. File values can be passed either as
// [`fs.ReadStream`] or as file-like object containing file
// name, mime-type and its content.
//
// [`fs.ReadStream`]: https://nodejs.org/api/fs.html#fs_class_fs_readstream
Multipart interface{} `json:"multipart"`
// Query parameters to be sent with the URL.
Params map[string]interface{} `json:"params"`
// Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
Timeout *float64 `json:"timeout"`
}
type APIRequestContextHeadOptions struct {
// Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
// and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
// header will be set to `application/octet-stream` if not explicitly set.
Data interface{} `json:"data"`
// Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
// codes.
FailOnStatusCode *bool `json:"failOnStatusCode"`
// Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
// as this request body. If this parameter is specified `content-type` header will be set to
// `application/x-www-form-urlencoded` unless explicitly provided.
Form interface{} `json:"form"`
// Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by
// it.
Headers map[string]string `json:"headers"`
// Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
IgnoreHttpsErrors *bool `json:"ignoreHTTPSErrors"`
// Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is
// exceeded. Defaults to `20`. Pass `0` to not follow redirects.
MaxRedirects *int `json:"maxRedirects"`
// Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not
// retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.
MaxRetries *int `json:"maxRetries"`
// Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
// request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
// explicitly provided. File values can be passed either as
// [`fs.ReadStream`] or as file-like object containing file
// name, mime-type and its content.
//
// [`fs.ReadStream`]: https://nodejs.org/api/fs.html#fs_class_fs_readstream
Multipart interface{} `json:"multipart"`
// Query parameters to be sent with the URL.
Params map[string]interface{} `json:"params"`
// Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
Timeout *float64 `json:"timeout"`
}
type APIRequestContextPatchOptions struct {
// Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
// and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
// header will be set to `application/octet-stream` if not explicitly set.
Data interface{} `json:"data"`
// Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
// codes.
FailOnStatusCode *bool `json:"failOnStatusCode"`
// Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
// as this request body. If this parameter is specified `content-type` header will be set to
// `application/x-www-form-urlencoded` unless explicitly provided.
Form interface{} `json:"form"`
// Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by
// it.
Headers map[string]string `json:"headers"`
// Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
IgnoreHttpsErrors *bool `json:"ignoreHTTPSErrors"`
// Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is
// exceeded. Defaults to `20`. Pass `0` to not follow redirects.
MaxRedirects *int `json:"maxRedirects"`
// Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not
// retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.
MaxRetries *int `json:"maxRetries"`
// Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
// request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
// explicitly provided. File values can be passed either as
// [`fs.ReadStream`] or as file-like object containing file
// name, mime-type and its content.
//
// [`fs.ReadStream`]: https://nodejs.org/api/fs.html#fs_class_fs_readstream
Multipart interface{} `json:"multipart"`
// Query parameters to be sent with the URL.
Params map[string]interface{} `json:"params"`
// Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
Timeout *float64 `json:"timeout"`
}
type APIRequestContextPostOptions struct {
// Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
// and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
// header will be set to `application/octet-stream` if not explicitly set.
Data interface{} `json:"data"`
// Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
// codes.
FailOnStatusCode *bool `json:"failOnStatusCode"`
// Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
// as this request body. If this parameter is specified `content-type` header will be set to
// `application/x-www-form-urlencoded` unless explicitly provided.
Form interface{} `json:"form"`
// Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by
// it.
Headers map[string]string `json:"headers"`
// Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
IgnoreHttpsErrors *bool `json:"ignoreHTTPSErrors"`
// Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is
// exceeded. Defaults to `20`. Pass `0` to not follow redirects.
MaxRedirects *int `json:"maxRedirects"`
// Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not
// retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.
MaxRetries *int `json:"maxRetries"`
// Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
// request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
// explicitly provided. File values can be passed either as
// [`fs.ReadStream`] or as file-like object containing file
// name, mime-type and its content.
//
// [`fs.ReadStream`]: https://nodejs.org/api/fs.html#fs_class_fs_readstream
Multipart interface{} `json:"multipart"`
// Query parameters to be sent with the URL.
Params map[string]interface{} `json:"params"`
// Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
Timeout *float64 `json:"timeout"`
}
type APIRequestContextPutOptions struct {
// Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
// and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
// header will be set to `application/octet-stream` if not explicitly set.
Data interface{} `json:"data"`
// Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
// codes.
FailOnStatusCode *bool `json:"failOnStatusCode"`
// Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
// as this request body. If this parameter is specified `content-type` header will be set to
// `application/x-www-form-urlencoded` unless explicitly provided.
Form interface{} `json:"form"`
// Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by
// it.
Headers map[string]string `json:"headers"`
// Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
IgnoreHttpsErrors *bool `json:"ignoreHTTPSErrors"`
// Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is
// exceeded. Defaults to `20`. Pass `0` to not follow redirects.
MaxRedirects *int `json:"maxRedirects"`
// Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not
// retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.
MaxRetries *int `json:"maxRetries"`
// Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
// request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
// explicitly provided. File values can be passed either as
// [`fs.ReadStream`] or as file-like object containing file
// name, mime-type and its content.
//
// [`fs.ReadStream`]: https://nodejs.org/api/fs.html#fs_class_fs_readstream
Multipart interface{} `json:"multipart"`
// Query parameters to be sent with the URL.
Params map[string]interface{} `json:"params"`
// Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
Timeout *float64 `json:"timeout"`
}
type StorageState struct {
Cookies []Cookie `json:"cookies"`
Origins []Origin `json:"origins"`
}
type NameValue struct {
// Name of the header.
Name string `json:"name"`
// Value of the header.
Value string `json:"value"`
}
type BrowserCloseOptions struct {
// The reason to be reported to the operations interrupted by the browser closure.
Reason *string `json:"reason"`
}
type BrowserNewContextOptions struct {
// Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted.
AcceptDownloads *bool `json:"acceptDownloads"`
// When using [Page.Goto], [Page.Route], [Page.WaitForURL], [Page.ExpectRequest], or [Page.ExpectResponse] it takes
// the base URL in consideration by using the [`URL()`]
// constructor for building the corresponding URL. Unset by default. Examples:
// - baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`
// - baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in
// `http://localhost:3000/foo/bar.html`
// - baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in
// `http://localhost:3000/bar.html`
//
// [`URL()`]: https://developer.mozilla.org/en-US/docs/Web/API/URL/URL
BaseURL *string `json:"baseURL"`
// Toggles bypassing page's Content-Security-Policy. Defaults to `false`.
BypassCSP *bool `json:"bypassCSP"`
// TLS Client Authentication allows the server to request a client certificate and verify it.
//
// # Details
//
// An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`,
// a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally,
// `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided
// with an exact match to the request origin that the certificate is valid for.
// **NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it
// work by replacing `localhost` with `local.playwright`.
ClientCertificates []ClientCertificate `json:"clientCertificates"`
// Emulates `prefers-colors-scheme` media feature, supported values are `light`, `dark`, `no-preference`. See
// [Page.EmulateMedia] for more details. Passing `no-override` resets emulation to system defaults. Defaults to
// `light`.
ColorScheme *ColorScheme `json:"colorScheme"`
// Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about
// [emulating devices with device scale factor].
//
// [emulating devices with device scale factor]: https://playwright.dev/docs/emulation#devices
DeviceScaleFactor *float64 `json:"deviceScaleFactor"`
// An object containing additional HTTP headers to be sent with every request. Defaults to none.
ExtraHttpHeaders map[string]string `json:"extraHTTPHeaders"`
// Emulates `forced-colors` media feature, supported values are `active`, `none`. See [Page.EmulateMedia] for
// more details. Passing `no-override` resets emulation to system defaults. Defaults to `none`.
ForcedColors *ForcedColors `json:"forcedColors"`
Geolocation *Geolocation `json:"geolocation"`
// Specifies if viewport supports touch events. Defaults to false. Learn more about
// [mobile emulation].
//
// [mobile emulation]: https://playwright.dev/docs/emulation#devices
HasTouch *bool `json:"hasTouch"`
// Credentials for [HTTP authentication]. If no
// origin is specified, the username and password are sent to any servers upon unauthorized responses.
//
// [HTTP authentication]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication
HttpCredentials *HttpCredentials `json:"httpCredentials"`
// Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
IgnoreHttpsErrors *bool `json:"ignoreHTTPSErrors"`
// Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,
// so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more
// about [mobile emulation].
//
// [mobile emulation]: https://playwright.dev/docs/emulation#ismobile
IsMobile *bool `json:"isMobile"`
// Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about
// [disabling JavaScript].
//
// [disabling JavaScript]: https://playwright.dev/docs/emulation#javascript-enabled
JavaScriptEnabled *bool `json:"javaScriptEnabled"`
// Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,
// `Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default
// locale. Learn more about emulation in our [emulation guide].
//
// [emulation guide]: https://playwright.dev/docs/emulation#locale--timezone
Locale *string `json:"locale"`
// Does not enforce fixed viewport, allows resizing window in the headed mode.
NoViewport *bool `json:"noViewport"`
// Whether to emulate network being offline. Defaults to `false`. Learn more about
// [network emulation].
//
// [network emulation]: https://playwright.dev/docs/emulation#offline
Offline *bool `json:"offline"`
// A list of permissions to grant to all pages in this context. See [BrowserContext.GrantPermissions] for more
// details. Defaults to none.
Permissions []string `json:"permissions"`
// Network proxy settings to use with this context. Defaults to none.
Proxy *Proxy `json:"proxy"`
// Optional setting to control resource content management. If `omit` is specified, content is not persisted. If
// `attach` is specified, resources are persisted as separate files and all of these files are archived along with the
// HAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification.
RecordHarContent *HarContentPolicy `json:"recordHarContent"`
// When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,
// cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.
RecordHarMode *HarMode `json:"recordHarMode"`
// Optional setting to control whether to omit request content from the HAR. Defaults to `false`.
RecordHarOmitContent *bool `json:"recordHarOmitContent"`
// Enables [HAR] recording for all pages into the specified HAR file
// on the filesystem. If not specified, the HAR is not recorded. Make sure to call [BrowserContext.Close] for the HAR
// to be saved.
//
// [HAR]: http://www.softwareishard.com/blog/har-12-spec
RecordHarPath *string `json:"recordHarPath"`
RecordHarURLFilter interface{} `json:"recordHarUrlFilter"`
// Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded.
// Make sure to await [BrowserContext.Close] for videos to be saved.
RecordVideo *RecordVideo `json:"recordVideo"`
// Emulates `prefers-reduced-motion` media feature, supported values are `reduce`, `no-preference`. See
// [Page.EmulateMedia] for more details. Passing `no-override` resets emulation to system defaults. Defaults to
// `no-preference`.
ReducedMotion *ReducedMotion `json:"reducedMotion"`
// Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the
// “[object Object]” is set.
Screen *Size `json:"screen"`
// Whether to allow sites to register Service workers. Defaults to `allow`.
// - `allow`: [Service Workers] can be
// registered.
// - `block`: Playwright will block all registration of Service Workers.
//
// [Service Workers]: https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
ServiceWorkers *ServiceWorkerPolicy `json:"serviceWorkers"`
// Learn more about [storage state and auth].
// Populates context with given storage state. This option can be used to initialize context with logged-in
// information obtained via [BrowserContext.StorageState].
//
// [storage state and auth]: https://playwright.dev/docs/auth
StorageState *OptionalStorageState `json:"storageState"`
// Populates context with given storage state. This option can be used to initialize context with logged-in
// information obtained via [BrowserContext.StorageState]. Path to the file with saved storage state.
StorageStatePath *string `json:"storageStatePath"`
// If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on
// selectors that imply single target DOM element will throw when more than one element matches the selector. This
// option does not affect any Locator APIs (Locators are always strict). Defaults to `false`. See [Locator] to learn
// more about the strict mode.
StrictSelectors *bool `json:"strictSelectors"`
// Changes the timezone of the context. See
// [ICU's metaZones.txt]
// for a list of supported timezone IDs. Defaults to the system timezone.
//
// [ICU's metaZones.txt]: https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1
TimezoneId *string `json:"timezoneId"`
// Specific user agent to use in this context.
UserAgent *string `json:"userAgent"`
// Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed
// viewport. Learn more about [viewport emulation].
//
// [viewport emulation]: https://playwright.dev/docs/emulation#viewport
Viewport *Size `json:"viewport"`
}
type BrowserNewPageOptions struct {
// Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted.
AcceptDownloads *bool `json:"acceptDownloads"`
// When using [Page.Goto], [Page.Route], [Page.WaitForURL], [Page.ExpectRequest], or [Page.ExpectResponse] it takes
// the base URL in consideration by using the [`URL()`]
// constructor for building the corresponding URL. Unset by default. Examples:
// - baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`
// - baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in
// `http://localhost:3000/foo/bar.html`
// - baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in
// `http://localhost:3000/bar.html`
//
// [`URL()`]: https://developer.mozilla.org/en-US/docs/Web/API/URL/URL
BaseURL *string `json:"baseURL"`
// Toggles bypassing page's Content-Security-Policy. Defaults to `false`.
BypassCSP *bool `json:"bypassCSP"`
// TLS Client Authentication allows the server to request a client certificate and verify it.
//
// # Details
//
// An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`,
// a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally,
// `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided
// with an exact match to the request origin that the certificate is valid for.
// **NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it
// work by replacing `localhost` with `local.playwright`.
ClientCertificates []ClientCertificate `json:"clientCertificates"`
// Emulates `prefers-colors-scheme` media feature, supported values are `light`, `dark`, `no-preference`. See
// [Page.EmulateMedia] for more details. Passing `no-override` resets emulation to system defaults. Defaults to
// `light`.
ColorScheme *ColorScheme `json:"colorScheme"`
// Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about
// [emulating devices with device scale factor].
//
// [emulating devices with device scale factor]: https://playwright.dev/docs/emulation#devices
DeviceScaleFactor *float64 `json:"deviceScaleFactor"`
// An object containing additional HTTP headers to be sent with every request. Defaults to none.
ExtraHttpHeaders map[string]string `json:"extraHTTPHeaders"`
// Emulates `forced-colors` media feature, supported values are `active`, `none`. See [Page.EmulateMedia] for
// more details. Passing `no-override` resets emulation to system defaults. Defaults to `none`.
ForcedColors *ForcedColors `json:"forcedColors"`
Geolocation *Geolocation `json:"geolocation"`
// Specifies if viewport supports touch events. Defaults to false. Learn more about
// [mobile emulation].
//
// [mobile emulation]: https://playwright.dev/docs/emulation#devices
HasTouch *bool `json:"hasTouch"`
// Credentials for [HTTP authentication]. If no
// origin is specified, the username and password are sent to any servers upon unauthorized responses.
//
// [HTTP authentication]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication
HttpCredentials *HttpCredentials `json:"httpCredentials"`
// Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
IgnoreHttpsErrors *bool `json:"ignoreHTTPSErrors"`
// Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,
// so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more
// about [mobile emulation].
//
// [mobile emulation]: https://playwright.dev/docs/emulation#ismobile
IsMobile *bool `json:"isMobile"`
// Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about
// [disabling JavaScript].
//
// [disabling JavaScript]: https://playwright.dev/docs/emulation#javascript-enabled
JavaScriptEnabled *bool `json:"javaScriptEnabled"`
// Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,
// `Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default
// locale. Learn more about emulation in our [emulation guide].
//
// [emulation guide]: https://playwright.dev/docs/emulation#locale--timezone
Locale *string `json:"locale"`
// Does not enforce fixed viewport, allows resizing window in the headed mode.
NoViewport *bool `json:"noViewport"`
// Whether to emulate network being offline. Defaults to `false`. Learn more about
// [network emulation].
//
// [network emulation]: https://playwright.dev/docs/emulation#offline
Offline *bool `json:"offline"`
// A list of permissions to grant to all pages in this context. See [BrowserContext.GrantPermissions] for more
// details. Defaults to none.
Permissions []string `json:"permissions"`
// Network proxy settings to use with this context. Defaults to none.
Proxy *Proxy `json:"proxy"`
// Optional setting to control resource content management. If `omit` is specified, content is not persisted. If
// `attach` is specified, resources are persisted as separate files and all of these files are archived along with the
// HAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification.
RecordHarContent *HarContentPolicy `json:"recordHarContent"`
// When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,
// cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.
RecordHarMode *HarMode `json:"recordHarMode"`
// Optional setting to control whether to omit request content from the HAR. Defaults to `false`.
RecordHarOmitContent *bool `json:"recordHarOmitContent"`
// Enables [HAR] recording for all pages into the specified HAR file
// on the filesystem. If not specified, the HAR is not recorded. Make sure to call [BrowserContext.Close] for the HAR
// to be saved.
//
// [HAR]: http://www.softwareishard.com/blog/har-12-spec
RecordHarPath *string `json:"recordHarPath"`
RecordHarURLFilter interface{} `json:"recordHarUrlFilter"`
// Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded.
// Make sure to await [BrowserContext.Close] for videos to be saved.
RecordVideo *RecordVideo `json:"recordVideo"`
// Emulates `prefers-reduced-motion` media feature, supported values are `reduce`, `no-preference`. See
// [Page.EmulateMedia] for more details. Passing `no-override` resets emulation to system defaults. Defaults to
// `no-preference`.
ReducedMotion *ReducedMotion `json:"reducedMotion"`
// Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the
// “[object Object]” is set.
Screen *Size `json:"screen"`
// Whether to allow sites to register Service workers. Defaults to `allow`.
// - `allow`: [Service Workers] can be
// registered.
// - `block`: Playwright will block all registration of Service Workers.
//
// [Service Workers]: https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
ServiceWorkers *ServiceWorkerPolicy `json:"serviceWorkers"`
// Learn more about [storage state and auth].
// Populates context with given storage state. This option can be used to initialize context with logged-in
// information obtained via [BrowserContext.StorageState].
//
// [storage state and auth]: https://playwright.dev/docs/auth
StorageState *OptionalStorageState `json:"storageState"`
// Populates context with given storage state. This option can be used to initialize context with logged-in
// information obtained via [BrowserContext.StorageState]. Path to the file with saved storage state.
StorageStatePath *string `json:"storageStatePath"`
// If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on
// selectors that imply single target DOM element will throw when more than one element matches the selector. This
// option does not affect any Locator APIs (Locators are always strict). Defaults to `false`. See [Locator] to learn
// more about the strict mode.
StrictSelectors *bool `json:"strictSelectors"`
// Changes the timezone of the context. See
// [ICU's metaZones.txt]
// for a list of supported timezone IDs. Defaults to the system timezone.
//
// [ICU's metaZones.txt]: https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1
TimezoneId *string `json:"timezoneId"`
// Specific user agent to use in this context.
UserAgent *string `json:"userAgent"`
// Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed
// viewport. Learn more about [viewport emulation].
//
// [viewport emulation]: https://playwright.dev/docs/emulation#viewport
Viewport *Size `json:"viewport"`
}
type BrowserStartTracingOptions struct {
// specify custom categories to use instead of default.
Categories []string `json:"categories"`
// Optional, if specified, tracing includes screenshots of the given page.
Page Page `json:"page"`
// A path to write the trace file to.
Path *string `json:"path"`
// captures screenshots in the trace.
Screenshots *bool `json:"screenshots"`
}
type OptionalCookie struct {
Name string `json:"name"`
Value string `json:"value"`
// Either url or domain / path are required. Optional.
URL *string `json:"url"`
// For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com". Either url
// or domain / path are required. Optional.
Domain *string `json:"domain"`
// Either url or domain / path are required Optional.
Path *string `json:"path"`
// Unix time in seconds. Optional.
Expires *float64 `json:"expires"`
// Optional.
HttpOnly *bool `json:"httpOnly"`
// Optional.
Secure *bool `json:"secure"`
// Optional.
SameSite *SameSiteAttribute `json:"sameSite"`
}
type Script struct {
// Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working
// directory. Optional.
Path *string `json:"path"`
// Raw script content. Optional.
Content *string `json:"content"`
}
type BrowserContextClearCookiesOptions struct {
// Only removes cookies with the given domain.
Domain interface{} `json:"domain"`
// Only removes cookies with the given name.
Name interface{} `json:"name"`
// Only removes cookies with the given path.
Path interface{} `json:"path"`
}
type BrowserContextCloseOptions struct {
// The reason to be reported to the operations interrupted by the context closure.
Reason *string `json:"reason"`
}
type Cookie struct {
Name string `json:"name"`
Value string `json:"value"`
Domain string `json:"domain"`
Path string `json:"path"`
// Unix time in seconds.
Expires float64 `json:"expires"`
HttpOnly bool `json:"httpOnly"`
Secure bool `json:"secure"`
SameSite *SameSiteAttribute `json:"sameSite"`
}
type BrowserContextGrantPermissionsOptions struct {
// The [origin] to grant permissions to, e.g. "https://example.com".
Origin *string `json:"origin"`
}
type BrowserContextRouteFromHAROptions struct {
// - If set to 'abort' any request not found in the HAR file will be aborted.
// - If set to 'fallback' falls through to the next route handler in the handler chain.
// Defaults to abort.
NotFound *HarNotFound `json:"notFound"`
// If specified, updates the given HAR with the actual network information instead of serving from file. The file is
// written to disk when [BrowserContext.Close] is called.
Update *bool `json:"update"`
// Optional setting to control resource content management. If `attach` is specified, resources are persisted as
// separate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file.
UpdateContent *RouteFromHarUpdateContentPolicy `json:"updateContent"`
// When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,
// cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to
// `minimal`.
UpdateMode *HarMode `json:"updateMode"`
// A glob pattern, regular expression or predicate to match the request URL. Only requests with URL matching the
// pattern will be served from the HAR file. If not specified, all requests are served from the HAR file.
URL interface{} `json:"url"`
}
type Geolocation struct {
// Latitude between -90 and 90.
Latitude float64 `json:"latitude"`
// Longitude between -180 and 180.
Longitude float64 `json:"longitude"`
// Non-negative accuracy value. Defaults to `0`.
Accuracy *float64 `json:"accuracy"`
}
type BrowserContextUnrouteAllOptions struct {
// Specifies whether to wait for already running handlers and what to do if they throw errors:
// - `default` - do not wait for current handler calls (if any) to finish, if unrouted handler throws, it may
// result in unhandled error
// - `wait` - wait for current handler calls (if any) to finish
// - `ignoreErrors` - do not wait for current handler calls (if any) to finish, all errors thrown by the handlers
// after unrouting are silently caught
Behavior *UnrouteBehavior `json:"behavior"`
}
type BrowserContextExpectConsoleMessageOptions struct {
// Receives the [ConsoleMessage] object and resolves to truthy value when the waiting should resolve.
Predicate func(ConsoleMessage) bool `json:"predicate"`
// Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The
// default value can be changed by using the [BrowserContext.SetDefaultTimeout].
Timeout *float64 `json:"timeout"`
}
type BrowserContextExpectEventOptions struct {
// Receives the event data and resolves to truthy value when the waiting should resolve.
Predicate interface{} `json:"predicate"`
// Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The
// default value can be changed by using the [BrowserContext.SetDefaultTimeout].
Timeout *float64 `json:"timeout"`
}
type BrowserContextExpectPageOptions struct {
// Receives the [Page] object and resolves to truthy value when the waiting should resolve.
Predicate func(Page) bool `json:"predicate"`
// Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The
// default value can be changed by using the [BrowserContext.SetDefaultTimeout].
Timeout *float64 `json:"timeout"`
}
type BrowserContextWaitForEventOptions struct {
// Receives the event data and resolves to truthy value when the waiting should resolve.
Predicate interface{} `json:"predicate"`
// Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The
// default value can be changed by using the [BrowserContext.SetDefaultTimeout].
Timeout *float64 `json:"timeout"`
}
type BrowserTypeConnectOptions struct {
// This option exposes network available on the connecting client to the browser being connected to. Consists of a
// list of rules separated by comma.
// Available rules:
// 1. Hostname pattern, for example: `example.com`, `*.org:99`, `x.*.y.com`, `*foo.org`.
// 2. IP literal, for example: `127.0.0.1`, `0.0.0.0:99`, `[::1]`, `[0:0::1]:99`.
// 3. `<loopback>` that matches local loopback interfaces: `localhost`, `*.localhost`, `127.0.0.1`, `[::1]`.
// Some common examples:
// 4. `"*"` to expose all network.
// 5. `"<loopback>"` to expose localhost network.
// 6. `"*.test.internal-domain,*.staging.internal-domain,<loopback>"` to expose test/staging deployments and
// localhost.
ExposeNetwork *string `json:"exposeNetwork"`
// Additional HTTP headers to be sent with web socket connect request. Optional.
Headers map[string]string `json:"headers"`
// Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going
// on. Defaults to 0.
SlowMo *float64 `json:"slowMo"`
// Maximum time in milliseconds to wait for the connection to be established. Defaults to `0` (no timeout).
Timeout *float64 `json:"timeout"`
}
type BrowserTypeConnectOverCDPOptions struct {
// Additional HTTP headers to be sent with connect request. Optional.
Headers map[string]string `json:"headers"`
// Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going
// on. Defaults to 0.
SlowMo *float64 `json:"slowMo"`
// Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass
// `0` to disable timeout.
Timeout *float64 `json:"timeout"`
}
type BrowserTypeLaunchOptions struct {
// **NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.
// Additional arguments to pass to the browser instance. The list of Chromium flags can be found
// [here].
//
// [here]: https://peter.sh/experiments/chromium-command-line-switches/
Args []string `json:"args"`
// Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary",
// "msedge", "msedge-beta", "msedge-dev", "msedge-canary". Read more about using
// [Google Chrome and Microsoft Edge].
//
// [Google Chrome and Microsoft Edge]: https://playwright.dev/docs/browsers#google-chrome--microsoft-edge
Channel *string `json:"channel"`
// Enable Chromium sandboxing. Defaults to `false`.
ChromiumSandbox *bool `json:"chromiumSandbox"`
// **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the
// “[object Object]” option will be set `false`.
//
// Deprecated: Use [debugging tools] instead.
//
// [debugging tools]: https://playwright.dev/docs/debug
Devtools *bool `json:"devtools"`
// If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and
// is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were
// created in is closed.
DownloadsPath *string `json:"downloadsPath"`
// Specify environment variables that will be visible to the browser. Defaults to `process.env`.
Env map[string]string `json:"env"`
// Path to a browser executable to run instead of the bundled one. If “[object Object]” is a relative path, then it is
// resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium,
// Firefox or WebKit, use at your own risk.
ExecutablePath *string `json:"executablePath"`
// Firefox user preferences. Learn more about the Firefox user preferences at
// [`about:config`].
//
// [`about:config`]: https://support.mozilla.org/en-US/kb/about-config-editor-firefox
FirefoxUserPrefs map[string]interface{} `json:"firefoxUserPrefs"`
// Close the browser process on SIGHUP. Defaults to `true`.
HandleSIGHUP *bool `json:"handleSIGHUP"`
// Close the browser process on Ctrl-C. Defaults to `true`.
HandleSIGINT *bool `json:"handleSIGINT"`
// Close the browser process on SIGTERM. Defaults to `true`.
HandleSIGTERM *bool `json:"handleSIGTERM"`
// Whether to run browser in headless mode. More details for
// [Chromium] and
// [Firefox]. Defaults to `true` unless the
// “[object Object]” option is `true`.
//
// [Chromium]: https://developers.google.com/web/updates/2017/04/headless-chrome
// [Firefox]: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode
Headless *bool `json:"headless"`
// If `true`, Playwright does not pass its own configurations args and only uses the ones from “[object Object]”.
// Dangerous option; use with care. Defaults to `false`.
IgnoreAllDefaultArgs *bool `json:"ignoreAllDefaultArgs"`
// If `true`, Playwright does not pass its own configurations args and only uses the ones from “[object Object]”.
// Dangerous option; use with care.
IgnoreDefaultArgs []string `json:"ignoreDefaultArgs"`
// Network proxy settings.
Proxy *Proxy `json:"proxy"`
// Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going
// on.
SlowMo *float64 `json:"slowMo"`
// Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0`
// to disable timeout.
Timeout *float64 `json:"timeout"`
// If specified, traces are saved into this directory.
TracesDir *string `json:"tracesDir"`
}
type BrowserTypeLaunchPersistentContextOptions struct {
// Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted.
AcceptDownloads *bool `json:"acceptDownloads"`
// **NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.
// Additional arguments to pass to the browser instance. The list of Chromium flags can be found
// [here].
//
// [here]: https://peter.sh/experiments/chromium-command-line-switches/
Args []string `json:"args"`
// When using [Page.Goto], [Page.Route], [Page.WaitForURL], [Page.ExpectRequest], or [Page.ExpectResponse] it takes
// the base URL in consideration by using the [`URL()`]
// constructor for building the corresponding URL. Unset by default. Examples:
// - baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`
// - baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in
// `http://localhost:3000/foo/bar.html`
// - baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in
// `http://localhost:3000/bar.html`
//
// [`URL()`]: https://developer.mozilla.org/en-US/docs/Web/API/URL/URL
BaseURL *string `json:"baseURL"`
// Toggles bypassing page's Content-Security-Policy. Defaults to `false`.
BypassCSP *bool `json:"bypassCSP"`
// Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary",
// "msedge", "msedge-beta", "msedge-dev", "msedge-canary". Read more about using
// [Google Chrome and Microsoft Edge].
//
// [Google Chrome and Microsoft Edge]: https://playwright.dev/docs/browsers#google-chrome--microsoft-edge
Channel *string `json:"channel"`
// Enable Chromium sandboxing. Defaults to `false`.
ChromiumSandbox *bool `json:"chromiumSandbox"`
// TLS Client Authentication allows the server to request a client certificate and verify it.
//
// # Details
//
// An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`,
// a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally,
// `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided
// with an exact match to the request origin that the certificate is valid for.
// **NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it
// work by replacing `localhost` with `local.playwright`.
ClientCertificates []ClientCertificate `json:"clientCertificates"`
// Emulates `prefers-colors-scheme` media feature, supported values are `light`, `dark`, `no-preference`. See
// [Page.EmulateMedia] for more details. Passing `no-override` resets emulation to system defaults. Defaults to
// `light`.
ColorScheme *ColorScheme `json:"colorScheme"`
// Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about
// [emulating devices with device scale factor].
//
// [emulating devices with device scale factor]: https://playwright.dev/docs/emulation#devices
DeviceScaleFactor *float64 `json:"deviceScaleFactor"`
// **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the
// “[object Object]” option will be set `false`.
//
// Deprecated: Use [debugging tools] instead.
//
// [debugging tools]: https://playwright.dev/docs/debug
Devtools *bool `json:"devtools"`
// If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and
// is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were
// created in is closed.
DownloadsPath *string `json:"downloadsPath"`
// Specify environment variables that will be visible to the browser. Defaults to `process.env`.
Env map[string]string `json:"env"`
// Path to a browser executable to run instead of the bundled one. If “[object Object]” is a relative path, then it is
// resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium,
// Firefox or WebKit, use at your own risk.
ExecutablePath *string `json:"executablePath"`
// An object containing additional HTTP headers to be sent with every request. Defaults to none.
ExtraHttpHeaders map[string]string `json:"extraHTTPHeaders"`
// Firefox user preferences. Learn more about the Firefox user preferences at
// [`about:config`].
//
// [`about:config`]: https://support.mozilla.org/en-US/kb/about-config-editor-firefox
FirefoxUserPrefs map[string]interface{} `json:"firefoxUserPrefs"`
// Emulates `forced-colors` media feature, supported values are `active`, `none`. See [Page.EmulateMedia] for
// more details. Passing `no-override` resets emulation to system defaults. Defaults to `none`.
ForcedColors *ForcedColors `json:"forcedColors"`
Geolocation *Geolocation `json:"geolocation"`
// Close the browser process on SIGHUP. Defaults to `true`.
HandleSIGHUP *bool `json:"handleSIGHUP"`
// Close the browser process on Ctrl-C. Defaults to `true`.
HandleSIGINT *bool `json:"handleSIGINT"`
// Close the browser process on SIGTERM. Defaults to `true`.
HandleSIGTERM *bool `json:"handleSIGTERM"`
// Specifies if viewport supports touch events. Defaults to false. Learn more about
// [mobile emulation].
//
// [mobile emulation]: https://playwright.dev/docs/emulation#devices
HasTouch *bool `json:"hasTouch"`
// Whether to run browser in headless mode. More details for
// [Chromium] and
// [Firefox]. Defaults to `true` unless the
// “[object Object]” option is `true`.
//
// [Chromium]: https://developers.google.com/web/updates/2017/04/headless-chrome
// [Firefox]: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode
Headless *bool `json:"headless"`
// Credentials for [HTTP authentication]. If no
// origin is specified, the username and password are sent to any servers upon unauthorized responses.
//
// [HTTP authentication]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication
HttpCredentials *HttpCredentials `json:"httpCredentials"`
// If `true`, Playwright does not pass its own configurations args and only uses the ones from “[object Object]”.
// Dangerous option; use with care. Defaults to `false`.
IgnoreAllDefaultArgs *bool `json:"ignoreAllDefaultArgs"`
// If `true`, Playwright does not pass its own configurations args and only uses the ones from “[object Object]”.
// Dangerous option; use with care.
IgnoreDefaultArgs []string `json:"ignoreDefaultArgs"`
// Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
IgnoreHttpsErrors *bool `json:"ignoreHTTPSErrors"`
// Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,
// so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more
// about [mobile emulation].
//
// [mobile emulation]: https://playwright.dev/docs/emulation#ismobile
IsMobile *bool `json:"isMobile"`
// Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about
// [disabling JavaScript].
//
// [disabling JavaScript]: https://playwright.dev/docs/emulation#javascript-enabled
JavaScriptEnabled *bool `json:"javaScriptEnabled"`
// Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,
// `Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default
// locale. Learn more about emulation in our [emulation guide].
//
// [emulation guide]: https://playwright.dev/docs/emulation#locale--timezone
Locale *string `json:"locale"`
// Does not enforce fixed viewport, allows resizing window in the headed mode.
NoViewport *bool `json:"noViewport"`