forked from playwright-community/playwright-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generated-structs.go
3609 lines (3595 loc) · 181 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()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/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`
BaseURL *string `json:"baseURL"`
// An object containing additional HTTP headers to be sent with every request.
ExtraHttpHeaders map[string]string `json:"extraHTTPHeaders"`
// Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).
HttpCredentials *APIRequestNewContextOptionsHttpCredentials `json:"httpCredentials"`
// Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
IgnoreHttpsErrors *bool `json:"ignoreHTTPSErrors"`
// Network proxy settings.
Proxy *APIRequestNewContextOptionsProxy `json:"proxy"`
// 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 APIRequestHttpCredentials struct {
Username *string `json:"username"`
Password *string `json:"password"`
}
type APIRequestProxy struct {
// Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example
// `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128`
// is considered an HTTP proxy.
Server *string `json:"server"`
// Optional comma-separated domains to bypass proxy, for example `".com, chromium.org,
// .domain.com"`.
Bypass *string `json:"bypass"`
// Optional username to use if HTTP proxy requires authentication.
Username *string `json:"username"`
// Optional password to use if HTTP proxy requires authentication.
Password *string `json:"password"`
}
// Result of calling <see cref="APIRequestContext.StorageState" />.
type APIRequestContextStorageStateResult struct {
Cookies []APIRequestContextStorageStateResultCookies `json:"cookies"`
Origins []APIRequestContextStorageStateResultOrigins `json:"origins"`
}
type APIRequestContextStorageStateOptions struct {
// The file path to save the storage state to. If `path` is a relative path, then it
// is resolved relative to current working directory. If no path is provided, storage
// state is still returned, but won't be saved to the disk.
Path *string `json:"path"`
}
// Result of calling <see cref="APIResponse.HeadersArray" />.
type APIResponseHeadersArrayResult struct {
// Name of the header.
Name string `json:"name"`
// Value of the header.
Value string `json:"value"`
}
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.WaitForRequest(),
// or Page.WaitForResponse() it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL)
// constructor for building the corresponding URL. 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`
BaseURL *string `json:"baseURL"`
// Toggles bypassing page's Content-Security-Policy.
BypassCSP *bool `json:"bypassCSP"`
// Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`,
// `'dark'`, `'no-preference'`. See Page.EmulateMedia() for more details. Defaults
// to `'light'`.
ColorScheme *ColorScheme `json:"colorScheme"`
// Specify device scale factor (can be thought of as dpr). Defaults to `1`.
DeviceScaleFactor *float64 `json:"deviceScaleFactor"`
// An object containing additional HTTP headers to be sent with every request.
ExtraHttpHeaders map[string]string `json:"extraHTTPHeaders"`
// Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`.
// See Page.EmulateMedia() for more details. Defaults to `'none'`.
// It's not supported in WebKit, see [here](https://bugs.webkit.org/show_bug.cgi?id=225281)
// in their issue tracker.
ForcedColors *ForcedColors `json:"forcedColors"`
Geolocation *BrowserNewContextOptionsGeolocation `json:"geolocation"`
// Specifies if viewport supports touch events. Defaults to false.
HasTouch *bool `json:"hasTouch"`
// Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).
HttpCredentials *BrowserNewContextOptionsHttpCredentials `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.
// Defaults to `false`. Not supported in Firefox.
IsMobile *bool `json:"isMobile"`
// Whether or not to enable JavaScript in the context. Defaults to `true`.
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.
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`.
Offline *bool `json:"offline"`
// A list of permissions to grant to all pages in this context. See BrowserContext.GrantPermissions()
// for more details.
Permissions []string `json:"permissions"`
// Network proxy settings to use with this context.
// For Chromium on Windows the browser needs to be launched with the global proxy for
// this option to work. If all contexts override the proxy, global proxy will be never
// used and can be any string, for example `launch({ proxy: { server: 'http://per-context'
// } })`.
Proxy *BrowserNewContextOptionsProxy `json:"proxy"`
// Optional setting to control whether to omit request content from the HAR. Defaults
// to `false`.
RecordHarOmitContent *bool `json:"recordHarOmitContent"`
// Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) 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.
RecordHarPath *string `json:"recordHarPath"`
// 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 *BrowserNewContextOptionsRecordVideo `json:"recordVideo"`
// Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`,
// `'no-preference'`. See Page.EmulateMedia() for more details. 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 `viewport` is set.
Screen *BrowserNewContextOptionsScreen `json:"screen"`
// Whether to allow sites to register Service workers. Defaults to `'allow'`.
// `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API)
// can be registered.
// `'block'`: Playwright will block all registration of Service Workers.
ServiceWorkers *ServiceWorkerPolicy `json:"serviceWorkers"`
// Populates context with given storage state. This option can be used to initialize
// context with logged-in information obtained via BrowserContext.StorageState(). Either
// a path to the file with saved storage, or an object with the following fields:
StorageState *BrowserNewContextOptionsStorageState `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 specified, 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. See Locator to learn more about
// the strict mode.
StrictSelectors *bool `json:"strictSelectors"`
// Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)
// for a list of supported timezone IDs.
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.
Viewport *BrowserNewContextOptionsViewport `json:"viewport"`
}
type BrowserGeolocation 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 BrowserHttpCredentials struct {
Username *string `json:"username"`
Password *string `json:"password"`
}
type BrowserProxy struct {
// Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example
// `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128`
// is considered an HTTP proxy.
Server *string `json:"server"`
// Optional comma-separated domains to bypass proxy, for example `".com, chromium.org,
// .domain.com"`.
Bypass *string `json:"bypass"`
// Optional username to use if HTTP proxy requires authentication.
Username *string `json:"username"`
// Optional password to use if HTTP proxy requires authentication.
Password *string `json:"password"`
}
type BrowserRecordVideo struct {
// Path to the directory to put videos into.
Dir *string `json:"dir"`
// Optional dimensions of the recorded videos. If not specified the size will be equal
// to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly
// the video size defaults to 800x450. Actual picture of each page will be scaled down
// if necessary to fit the specified size.
Size *BrowserRecordVideoSize `json:"size"`
}
type BrowserScreen struct {
// page width in pixels.
Width *int `json:"width"`
// page height in pixels.
Height *int `json:"height"`
}
type BrowserStorageState struct {
// cookies to set for context
Cookies []BrowserStorageStateCookies `json:"cookies"`
// localStorage to set for context
Origins []BrowserStorageStateOrigins `json:"origins"`
}
type BrowserViewport struct {
// page width in pixels.
Width *int `json:"width"`
// page height in pixels.
Height *int `json:"height"`
}
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.WaitForRequest(),
// or Page.WaitForResponse() it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL)
// constructor for building the corresponding URL. 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`
BaseURL *string `json:"baseURL"`
// Toggles bypassing page's Content-Security-Policy.
BypassCSP *bool `json:"bypassCSP"`
// Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`,
// `'dark'`, `'no-preference'`. See Page.EmulateMedia() for more details. Defaults
// to `'light'`.
ColorScheme *ColorScheme `json:"colorScheme"`
// Specify device scale factor (can be thought of as dpr). Defaults to `1`.
DeviceScaleFactor *float64 `json:"deviceScaleFactor"`
// An object containing additional HTTP headers to be sent with every request.
ExtraHttpHeaders map[string]string `json:"extraHTTPHeaders"`
// Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`.
// See Page.EmulateMedia() for more details. Defaults to `'none'`.
// It's not supported in WebKit, see [here](https://bugs.webkit.org/show_bug.cgi?id=225281)
// in their issue tracker.
ForcedColors *ForcedColors `json:"forcedColors"`
Geolocation *BrowserNewPageOptionsGeolocation `json:"geolocation"`
// Specifies if viewport supports touch events. Defaults to false.
HasTouch *bool `json:"hasTouch"`
// Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).
HttpCredentials *BrowserNewPageOptionsHttpCredentials `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.
// Defaults to `false`. Not supported in Firefox.
IsMobile *bool `json:"isMobile"`
// Whether or not to enable JavaScript in the context. Defaults to `true`.
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.
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`.
Offline *bool `json:"offline"`
// A list of permissions to grant to all pages in this context. See BrowserContext.GrantPermissions()
// for more details.
Permissions []string `json:"permissions"`
// Network proxy settings to use with this context.
// For Chromium on Windows the browser needs to be launched with the global proxy for
// this option to work. If all contexts override the proxy, global proxy will be never
// used and can be any string, for example `launch({ proxy: { server: 'http://per-context'
// } })`.
Proxy *BrowserNewPageOptionsProxy `json:"proxy"`
// Optional setting to control whether to omit request content from the HAR. Defaults
// to `false`.
RecordHarOmitContent *bool `json:"recordHarOmitContent"`
// Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) 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.
RecordHarPath *string `json:"recordHarPath"`
// 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 *BrowserNewPageOptionsRecordVideo `json:"recordVideo"`
// Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`,
// `'no-preference'`. See Page.EmulateMedia() for more details. 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 `viewport` is set.
Screen *BrowserNewPageOptionsScreen `json:"screen"`
// Whether to allow sites to register Service workers. Defaults to `'allow'`.
// `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API)
// can be registered.
// `'block'`: Playwright will block all registration of Service Workers.
ServiceWorkers *ServiceWorkerPolicy `json:"serviceWorkers"`
// Populates context with given storage state. This option can be used to initialize
// context with logged-in information obtained via BrowserContext.StorageState(). Either
// a path to the file with saved storage, or an object with the following fields:
StorageState *BrowserNewPageOptionsStorageState `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 specified, 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. See Locator to learn more about
// the strict mode.
StrictSelectors *bool `json:"strictSelectors"`
// Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)
// for a list of supported timezone IDs.
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.
Viewport *BrowserNewPageOptionsViewport `json:"viewport"`
}
type BrowserContextAddCookiesOptions struct {
Cookies []BrowserContextAddCookiesOptionsCookies `json:"cookies"`
}
type BrowserContextCookies struct {
Name *string `json:"name"`
Value *string `json:"value"`
// either url or domain / path are required. Optional.
URL *string `json:"url"`
// 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 BrowserContextAddInitScriptOptions struct {
// Optional Script source to be evaluated in all pages in the browser context.
Script *string `json:"script"`
// Optional Script path to be evaluated in all pages in the browser context.
Path *string `json:"path"`
}
// Result of calling <see cref="BrowserContext.Cookies" />.
type BrowserContextCookiesResult 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 BrowserContextCookiesOptions struct {
// Optional list of URLs.
Urls []string `json:"urls"`
}
type BrowserContextExposeBindingOptions struct {
// Whether to pass the argument as a handle, instead of passing by value. When passing
// a handle, only one argument is supported. When passing by value, multiple arguments
// are supported.
Handle *bool `json:"handle"`
}
type BrowserContextGrantPermissionsOptions struct {
// The [origin] to grant permissions to, e.g. "https://example.com".
Origin *string `json:"origin"`
}
type BrowserContextRouteOptions struct {
// How often a route should be used. By default it will be used every time.
Times *int `json:"times"`
}
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.
Update *bool `json:"update"`
// 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 BrowserContextGeolocation 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"`
}
// Result of calling <see cref="BrowserContext.StorageState" />.
type BrowserContextStorageStateResult struct {
Cookies []BrowserContextStorageStateResultCookies `json:"cookies"`
Origins []BrowserContextStorageStateResultOrigins `json:"origins"`
}
type BrowserContextStorageStateOptions struct {
// The file path to save the storage state to. If `path` is a relative path, then it
// is resolved relative to current working directory. If no path is provided, storage
// state is still returned, but won't be saved to the disk.
Path *string `json:"path"`
}
type BrowserContextUnrouteOptions struct {
// Optional handler function used to register a routing with BrowserContext.Route().
Handler func(Route, Request) `json:"handler"`
}
type BrowserTypeConnectOptions struct {
// 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 {
// Additional arguments to pass to the browser instance. The list of Chromium flags
// can be found [here](http://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](../browsers.md#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 `headless` option will be set `false`.
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 `executablePath`
// 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`](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](https://developers.google.com/web/updates/2017/04/headless-chrome)
// and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode).
// Defaults to `true` unless the `devtools` option is `true`.
Headless *bool `json:"headless"`
// If `true`, Playwright does not pass its own configurations args and only uses the
// ones from `args`. 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 `args`. Dangerous option; use with care.
IgnoreDefaultArgs []string `json:"ignoreDefaultArgs"`
// Network proxy settings.
Proxy *BrowserTypeLaunchOptionsProxy `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 BrowserTypeProxy struct {
// Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example
// `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128`
// is considered an HTTP proxy.
Server *string `json:"server"`
// Optional comma-separated domains to bypass proxy, for example `".com, chromium.org,
// .domain.com"`.
Bypass *string `json:"bypass"`
// Optional username to use if HTTP proxy requires authentication.
Username *string `json:"username"`
// Optional password to use if HTTP proxy requires authentication.
Password *string `json:"password"`
}
type BrowserTypeLaunchPersistentContextOptions struct {
// Whether to automatically download all the attachments. Defaults to `true` where
// all the downloads are accepted.
AcceptDownloads *bool `json:"acceptDownloads"`
// Additional arguments to pass to the browser instance. The list of Chromium flags
// can be found [here](http://peter.sh/experiments/chromium-command-line-switches/).
Args []string `json:"args"`
// When using Page.Goto(), Page.Route(), Page.WaitForURL(), Page.WaitForRequest(),
// or Page.WaitForResponse() it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL)
// constructor for building the corresponding URL. 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`
BaseURL *string `json:"baseURL"`
// Toggles bypassing page's Content-Security-Policy.
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](../browsers.md#google-chrome--microsoft-edge).
Channel *string `json:"channel"`
// Enable Chromium sandboxing. Defaults to `false`.
ChromiumSandbox *bool `json:"chromiumSandbox"`
// Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`,
// `'dark'`, `'no-preference'`. See Page.EmulateMedia() for more details. Defaults
// to `'light'`.
ColorScheme *ColorScheme `json:"colorScheme"`
// Specify device scale factor (can be thought of as dpr). Defaults to `1`.
DeviceScaleFactor *float64 `json:"deviceScaleFactor"`
// **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If
// this option is `true`, the `headless` option will be set `false`.
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 `executablePath`
// 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.
ExtraHttpHeaders map[string]string `json:"extraHTTPHeaders"`
// Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`.
// See Page.EmulateMedia() for more details. Defaults to `'none'`.
// It's not supported in WebKit, see [here](https://bugs.webkit.org/show_bug.cgi?id=225281)
// in their issue tracker.
ForcedColors *ForcedColors `json:"forcedColors"`
Geolocation *BrowserTypeLaunchPersistentContextOptionsGeolocation `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.
HasTouch *bool `json:"hasTouch"`
// Whether to run browser in headless mode. More details for [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome)
// and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode).
// Defaults to `true` unless the `devtools` option is `true`.
Headless *bool `json:"headless"`
// Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).
HttpCredentials *BrowserTypeLaunchPersistentContextOptionsHttpCredentials `json:"httpCredentials"`
// If `true`, Playwright does not pass its own configurations args and only uses the
// ones from `args`. 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 `args`. 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.
// Defaults to `false`. Not supported in Firefox.
IsMobile *bool `json:"isMobile"`
// Whether or not to enable JavaScript in the context. Defaults to `true`.
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.
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`.
Offline *bool `json:"offline"`
// A list of permissions to grant to all pages in this context. See BrowserContext.GrantPermissions()
// for more details.
Permissions []string `json:"permissions"`
// Network proxy settings.
Proxy *BrowserTypeLaunchPersistentContextOptionsProxy `json:"proxy"`
// Optional setting to control whether to omit request content from the HAR. Defaults
// to `false`.
RecordHarOmitContent *bool `json:"recordHarOmitContent"`
// Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) 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.
RecordHarPath *string `json:"recordHarPath"`
// 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 *BrowserTypeLaunchPersistentContextOptionsRecordVideo `json:"recordVideo"`
// Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`,
// `'no-preference'`. See Page.EmulateMedia() for more details. 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 `viewport` is set.
Screen *BrowserTypeLaunchPersistentContextOptionsScreen `json:"screen"`
// Whether to allow sites to register Service workers. Defaults to `'allow'`.
// `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API)
// can be registered.
// `'block'`: Playwright will block all registration of Service Workers.
ServiceWorkers *ServiceWorkerPolicy `json:"serviceWorkers"`
// Slows down Playwright operations by the specified amount of milliseconds. Useful
// so that you can see what is going on.
SlowMo *float64 `json:"slowMo"`
// If specified, 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. See Locator to learn more about
// the strict mode.
StrictSelectors *bool `json:"strictSelectors"`
// 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"`
// Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)
// for a list of supported timezone IDs.
TimezoneId *string `json:"timezoneId"`
// If specified, traces are saved into this directory.
TracesDir *string `json:"tracesDir"`
// 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.
Viewport *BrowserTypeLaunchPersistentContextOptionsViewport `json:"viewport"`
}
type BrowserTypeGeolocation 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 BrowserTypeHttpCredentials struct {
Username *string `json:"username"`
Password *string `json:"password"`
}
type BrowserTypeRecordVideo struct {
// Path to the directory to put videos into.
Dir *string `json:"dir"`
// Optional dimensions of the recorded videos. If not specified the size will be equal
// to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly
// the video size defaults to 800x450. Actual picture of each page will be scaled down
// if necessary to fit the specified size.
Size *BrowserTypeRecordVideoSize `json:"size"`
}
type BrowserTypeScreen struct {
// page width in pixels.
Width *int `json:"width"`
// page height in pixels.
Height *int `json:"height"`
}
type BrowserTypeViewport struct {
// page width in pixels.
Width *int `json:"width"`
// page height in pixels.
Height *int `json:"height"`
}
type DialogAcceptOptions struct {
// A text to enter in prompt. Does not cause any effects if the dialog's `type` is
// not prompt. Optional.
PromptText *string `json:"promptText"`
}
// Result of calling <see cref="ElementHandle.BoundingBox" />.
type ElementHandleBoundingBoxResult struct {
// the x coordinate of the element in pixels.
X float64 `json:"x"`
// the y coordinate of the element in pixels.
Y float64 `json:"y"`
// the width of the element in pixels.
Width float64 `json:"width"`
// the height of the element in pixels.
Height float64 `json:"height"`
}
type ElementHandleCheckOptions struct {
// Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.
Force *bool `json:"force"`
// Actions that initiate navigations are waiting for these navigations to happen and
// for pages to start loading. You can opt out of waiting via setting this flag. You
// would only need this option in the exceptional cases such as navigating to inaccessible
// pages. Defaults to `false`.
NoWaitAfter *bool `json:"noWaitAfter"`
// A point to use relative to the top-left corner of element padding box. If not specified,
// uses some visible point of the element.
Position *ElementHandleCheckOptionsPosition `json:"position"`
// Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
// The default value can be changed by using the BrowserContext.SetDefaultTimeout()
// or Page.SetDefaultTimeout() methods.
Timeout *float64 `json:"timeout"`
// When set, this method only performs the [actionability](../actionability.md) checks
// and skips the action. Defaults to `false`. Useful to wait until the element is ready
// for the action without performing it.
Trial *bool `json:"trial"`
}
type ElementHandlePosition struct {
X *float64 `json:"x"`
Y *float64 `json:"y"`
}
type ElementHandleClickOptions struct {
// Defaults to `left`.
Button *MouseButton `json:"button"`
// defaults to 1. See [UIEvent.detail].
ClickCount *int `json:"clickCount"`
// Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.
Delay *float64 `json:"delay"`
// Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.
Force *bool `json:"force"`
// Modifier keys to press. Ensures that only these modifiers are pressed during the
// operation, and then restores current modifiers back. If not specified, currently
// pressed modifiers are used.
Modifiers []KeyboardModifier `json:"modifiers"`
// Actions that initiate navigations are waiting for these navigations to happen and
// for pages to start loading. You can opt out of waiting via setting this flag. You
// would only need this option in the exceptional cases such as navigating to inaccessible
// pages. Defaults to `false`.
NoWaitAfter *bool `json:"noWaitAfter"`
// A point to use relative to the top-left corner of element padding box. If not specified,
// uses some visible point of the element.
Position *ElementHandleClickOptionsPosition `json:"position"`
// Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
// The default value can be changed by using the BrowserContext.SetDefaultTimeout()
// or Page.SetDefaultTimeout() methods.
Timeout *float64 `json:"timeout"`
// When set, this method only performs the [actionability](../actionability.md) checks
// and skips the action. Defaults to `false`. Useful to wait until the element is ready
// for the action without performing it.
Trial *bool `json:"trial"`
}
type ElementHandleDblclickOptions struct {
// Defaults to `left`.
Button *MouseButton `json:"button"`
// Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.
Delay *float64 `json:"delay"`
// Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.
Force *bool `json:"force"`
// Modifier keys to press. Ensures that only these modifiers are pressed during the
// operation, and then restores current modifiers back. If not specified, currently
// pressed modifiers are used.
Modifiers []KeyboardModifier `json:"modifiers"`
// Actions that initiate navigations are waiting for these navigations to happen and
// for pages to start loading. You can opt out of waiting via setting this flag. You
// would only need this option in the exceptional cases such as navigating to inaccessible
// pages. Defaults to `false`.
NoWaitAfter *bool `json:"noWaitAfter"`
// A point to use relative to the top-left corner of element padding box. If not specified,
// uses some visible point of the element.
Position *ElementHandleDblclickOptionsPosition `json:"position"`
// Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
// The default value can be changed by using the BrowserContext.SetDefaultTimeout()
// or Page.SetDefaultTimeout() methods.
Timeout *float64 `json:"timeout"`
// When set, this method only performs the [actionability](../actionability.md) checks
// and skips the action. Defaults to `false`. Useful to wait until the element is ready
// for the action without performing it.
Trial *bool `json:"trial"`
}
type ElementHandleDispatchEventOptions struct {
// Optional event-specific initialization properties.
EventInit interface{} `json:"eventInit"`
}
type ElementHandleEvalOnSelectorOptions struct {
// Optional argument to pass to `expression`.
Arg interface{} `json:"arg"`
}
type ElementHandleEvalOnSelectorAllOptions struct {
// Optional argument to pass to `expression`.
Arg interface{} `json:"arg"`
}
type ElementHandleFillOptions struct {
// Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.
Force *bool `json:"force"`
// Actions that initiate navigations are waiting for these navigations to happen and
// for pages to start loading. You can opt out of waiting via setting this flag. You
// would only need this option in the exceptional cases such as navigating to inaccessible
// pages. Defaults to `false`.
NoWaitAfter *bool `json:"noWaitAfter"`
// Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
// The default value can be changed by using the BrowserContext.SetDefaultTimeout()
// or Page.SetDefaultTimeout() methods.
Timeout *float64 `json:"timeout"`
}
type ElementHandleHoverOptions struct {
// Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.
Force *bool `json:"force"`
// Modifier keys to press. Ensures that only these modifiers are pressed during the
// operation, and then restores current modifiers back. If not specified, currently
// pressed modifiers are used.
Modifiers []KeyboardModifier `json:"modifiers"`
// A point to use relative to the top-left corner of element padding box. If not specified,
// uses some visible point of the element.
Position *ElementHandleHoverOptionsPosition `json:"position"`
// Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
// The default value can be changed by using the BrowserContext.SetDefaultTimeout()
// or Page.SetDefaultTimeout() methods.
Timeout *float64 `json:"timeout"`
// When set, this method only performs the [actionability](../actionability.md) checks
// and skips the action. Defaults to `false`. Useful to wait until the element is ready
// for the action without performing it.
Trial *bool `json:"trial"`
}
type ElementHandleInputValueOptions struct {
// Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
// The default value can be changed by using the BrowserContext.SetDefaultTimeout()
// or Page.SetDefaultTimeout() methods.
Timeout *float64 `json:"timeout"`
}
type ElementHandlePressOptions struct {
// Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.
Delay *float64 `json:"delay"`
// Actions that initiate navigations are waiting for these navigations to happen and
// for pages to start loading. You can opt out of waiting via setting this flag. You
// would only need this option in the exceptional cases such as navigating to inaccessible
// pages. Defaults to `false`.
NoWaitAfter *bool `json:"noWaitAfter"`
// Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
// The default value can be changed by using the BrowserContext.SetDefaultTimeout()
// or Page.SetDefaultTimeout() methods.
Timeout *float64 `json:"timeout"`
}
type ElementHandleScreenshotOptions struct {
// When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations.
// Animations get different treatment depending on their duration:
// finite animations are fast-forwarded to completion, so they'll fire `transitionend`
// event.
// infinite animations are canceled to initial state, and then played over after the
// screenshot.
// Defaults to `"allow"` that leaves animations untouched.
Animations *ScreenshotAnimations `json:"animations"`
// When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`,
// text caret behavior will not be changed. Defaults to `"hide"`.
Caret *ScreenshotCaret `json:"caret"`
// Hides default white background and allows capturing screenshots with transparency.
// Not applicable to `jpeg` images. Defaults to `false`.
OmitBackground *bool `json:"omitBackground"`
// The file path to save the image to. The screenshot type will be inferred from file
// extension. If `path` is a relative path, then it is resolved relative to the current
// working directory. If no path is provided, the image won't be saved to the disk.
Path *string `json:"path"`
// The quality of the image, between 0-100. Not applicable to `png` images.
Quality *int `json:"quality"`
// When set to `"css"`, screenshot will have a single pixel per each css pixel on the
// page. For high-dpi devices, this will keep screenshots small. Using `"device"` option
// will produce a single pixel per each device pixel, so screenhots of high-dpi devices
// will be twice as large or even larger.
// Defaults to `"device"`.
Scale *ScreenshotScale `json:"scale"`
// Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
// The default value can be changed by using the BrowserContext.SetDefaultTimeout()
// or Page.SetDefaultTimeout() methods.
Timeout *float64 `json:"timeout"`
// Specify screenshot type, defaults to `png`.
Type *ScreenshotType `json:"type"`
}
type ElementHandleScrollIntoViewIfNeededOptions struct {
// Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
// The default value can be changed by using the BrowserContext.SetDefaultTimeout()
// or Page.SetDefaultTimeout() methods.
Timeout *float64 `json:"timeout"`
}
type ElementHandleSelectOptionOptions struct {
// Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.
Force *bool `json:"force"`
// Actions that initiate navigations are waiting for these navigations to happen and
// for pages to start loading. You can opt out of waiting via setting this flag. You
// would only need this option in the exceptional cases such as navigating to inaccessible
// pages. Defaults to `false`.
NoWaitAfter *bool `json:"noWaitAfter"`
// Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
// The default value can be changed by using the BrowserContext.SetDefaultTimeout()
// or Page.SetDefaultTimeout() methods.
Timeout *float64 `json:"timeout"`
}
type ElementHandleSelectTextOptions struct {
// Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.
Force *bool `json:"force"`
// Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
// The default value can be changed by using the BrowserContext.SetDefaultTimeout()
// or Page.SetDefaultTimeout() methods.
Timeout *float64 `json:"timeout"`
}
type ElementHandleSetCheckedOptions struct {
// Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.
Force *bool `json:"force"`
// Actions that initiate navigations are waiting for these navigations to happen and
// for pages to start loading. You can opt out of waiting via setting this flag. You
// would only need this option in the exceptional cases such as navigating to inaccessible
// pages. Defaults to `false`.
NoWaitAfter *bool `json:"noWaitAfter"`
// A point to use relative to the top-left corner of element padding box. If not specified,
// uses some visible point of the element.
Position *ElementHandleSetCheckedOptionsPosition `json:"position"`
// Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
// The default value can be changed by using the BrowserContext.SetDefaultTimeout()
// or Page.SetDefaultTimeout() methods.
Timeout *float64 `json:"timeout"`
// When set, this method only performs the [actionability](../actionability.md) checks
// and skips the action. Defaults to `false`. Useful to wait until the element is ready
// for the action without performing it.
Trial *bool `json:"trial"`
}
type ElementHandleSetInputFilesOptions struct {
// Actions that initiate navigations are waiting for these navigations to happen and
// for pages to start loading. You can opt out of waiting via setting this flag. You
// would only need this option in the exceptional cases such as navigating to inaccessible
// pages. Defaults to `false`.
NoWaitAfter *bool `json:"noWaitAfter"`
// Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
// The default value can be changed by using the BrowserContext.SetDefaultTimeout()
// or Page.SetDefaultTimeout() methods.
Timeout *float64 `json:"timeout"`
}
type ElementHandleTapOptions struct {
// Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.
Force *bool `json:"force"`
// Modifier keys to press. Ensures that only these modifiers are pressed during the
// operation, and then restores current modifiers back. If not specified, currently
// pressed modifiers are used.
Modifiers []KeyboardModifier `json:"modifiers"`
// Actions that initiate navigations are waiting for these navigations to happen and
// for pages to start loading. You can opt out of waiting via setting this flag. You
// would only need this option in the exceptional cases such as navigating to inaccessible
// pages. Defaults to `false`.
NoWaitAfter *bool `json:"noWaitAfter"`
// A point to use relative to the top-left corner of element padding box. If not specified,
// uses some visible point of the element.
Position *ElementHandleTapOptionsPosition `json:"position"`
// Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
// The default value can be changed by using the BrowserContext.SetDefaultTimeout()
// or Page.SetDefaultTimeout() methods.
Timeout *float64 `json:"timeout"`
// When set, this method only performs the [actionability](../actionability.md) checks
// and skips the action. Defaults to `false`. Useful to wait until the element is ready
// for the action without performing it.
Trial *bool `json:"trial"`
}
type ElementHandleTypeOptions struct {
// Time to wait between key presses in milliseconds. Defaults to 0.
Delay *float64 `json:"delay"`
// Actions that initiate navigations are waiting for these navigations to happen and
// for pages to start loading. You can opt out of waiting via setting this flag. You
// would only need this option in the exceptional cases such as navigating to inaccessible
// pages. Defaults to `false`.
NoWaitAfter *bool `json:"noWaitAfter"`
// Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
// The default value can be changed by using the BrowserContext.SetDefaultTimeout()
// or Page.SetDefaultTimeout() methods.
Timeout *float64 `json:"timeout"`
}
type ElementHandleUncheckOptions struct {
// Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.
Force *bool `json:"force"`
// Actions that initiate navigations are waiting for these navigations to happen and
// for pages to start loading. You can opt out of waiting via setting this flag. You
// would only need this option in the exceptional cases such as navigating to inaccessible
// pages. Defaults to `false`.
NoWaitAfter *bool `json:"noWaitAfter"`
// A point to use relative to the top-left corner of element padding box. If not specified,
// uses some visible point of the element.
Position *ElementHandleUncheckOptionsPosition `json:"position"`
// Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
// The default value can be changed by using the BrowserContext.SetDefaultTimeout()
// or Page.SetDefaultTimeout() methods.
Timeout *float64 `json:"timeout"`
// When set, this method only performs the [actionability](../actionability.md) checks
// and skips the action. Defaults to `false`. Useful to wait until the element is ready
// for the action without performing it.
Trial *bool `json:"trial"`
}
type ElementHandleWaitForElementStateOptions struct {
// Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
// The default value can be changed by using the BrowserContext.SetDefaultTimeout()
// or Page.SetDefaultTimeout() methods.
Timeout *float64 `json:"timeout"`
}
type ElementHandleWaitForSelectorOptions struct {
// Defaults to `'visible'`. Can be either:
// `'attached'` - wait for element to be present in DOM.
// `'detached'` - wait for element to not be present in DOM.
// `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`.
// Note that element without any content or with `display:none` has an empty bounding
// box and is not considered visible.
// `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding
// box or `visibility:hidden`. This is opposite to the `'visible'` option.
State *WaitForSelectorState `json:"state"`