vendor/github.com/go-rod/rod/lib/proto/browser.go

636 lines · 22388 bytes

  1// This file is generated by "./lib/proto/generate"
  2
  3package proto
  4
  5/*
  6
  7Browser
  8
  9The Browser domain defines methods and events for browser managing.
 10
 11*/
 12
 13// BrowserBrowserContextID (experimental) ...
 14type BrowserBrowserContextID string
 15
 16// BrowserWindowID (experimental) ...
 17type BrowserWindowID int
 18
 19// BrowserWindowState (experimental) The state of the browser window.
 20type BrowserWindowState string
 21
 22const (
 23	// BrowserWindowStateNormal enum const.
 24	BrowserWindowStateNormal BrowserWindowState = "normal"
 25
 26	// BrowserWindowStateMinimized enum const.
 27	BrowserWindowStateMinimized BrowserWindowState = "minimized"
 28
 29	// BrowserWindowStateMaximized enum const.
 30	BrowserWindowStateMaximized BrowserWindowState = "maximized"
 31
 32	// BrowserWindowStateFullscreen enum const.
 33	BrowserWindowStateFullscreen BrowserWindowState = "fullscreen"
 34)
 35
 36// BrowserBounds (experimental) Browser window bounds information.
 37type BrowserBounds struct {
 38	// Left (optional) The offset from the left edge of the screen to the window in pixels.
 39	Left *int `json:"left,omitempty"`
 40
 41	// Top (optional) The offset from the top edge of the screen to the window in pixels.
 42	Top *int `json:"top,omitempty"`
 43
 44	// Width (optional) The window width in pixels.
 45	Width *int `json:"width,omitempty"`
 46
 47	// Height (optional) The window height in pixels.
 48	Height *int `json:"height,omitempty"`
 49
 50	// WindowState (optional) The window state. Default to normal.
 51	WindowState BrowserWindowState `json:"windowState,omitempty"`
 52}
 53
 54// BrowserPermissionType (experimental) ...
 55type BrowserPermissionType string
 56
 57const (
 58	// BrowserPermissionTypeAccessibilityEvents enum const.
 59	BrowserPermissionTypeAccessibilityEvents BrowserPermissionType = "accessibilityEvents"
 60
 61	// BrowserPermissionTypeAudioCapture enum const.
 62	BrowserPermissionTypeAudioCapture BrowserPermissionType = "audioCapture"
 63
 64	// BrowserPermissionTypeBackgroundSync enum const.
 65	BrowserPermissionTypeBackgroundSync BrowserPermissionType = "backgroundSync"
 66
 67	// BrowserPermissionTypeBackgroundFetch enum const.
 68	BrowserPermissionTypeBackgroundFetch BrowserPermissionType = "backgroundFetch"
 69
 70	// BrowserPermissionTypeCapturedSurfaceControl enum const.
 71	BrowserPermissionTypeCapturedSurfaceControl BrowserPermissionType = "capturedSurfaceControl"
 72
 73	// BrowserPermissionTypeClipboardReadWrite enum const.
 74	BrowserPermissionTypeClipboardReadWrite BrowserPermissionType = "clipboardReadWrite"
 75
 76	// BrowserPermissionTypeClipboardSanitizedWrite enum const.
 77	BrowserPermissionTypeClipboardSanitizedWrite BrowserPermissionType = "clipboardSanitizedWrite"
 78
 79	// BrowserPermissionTypeDisplayCapture enum const.
 80	BrowserPermissionTypeDisplayCapture BrowserPermissionType = "displayCapture"
 81
 82	// BrowserPermissionTypeDurableStorage enum const.
 83	BrowserPermissionTypeDurableStorage BrowserPermissionType = "durableStorage"
 84
 85	// BrowserPermissionTypeFlash enum const.
 86	BrowserPermissionTypeFlash BrowserPermissionType = "flash"
 87
 88	// BrowserPermissionTypeGeolocation enum const.
 89	BrowserPermissionTypeGeolocation BrowserPermissionType = "geolocation"
 90
 91	// BrowserPermissionTypeIdleDetection enum const.
 92	BrowserPermissionTypeIdleDetection BrowserPermissionType = "idleDetection"
 93
 94	// BrowserPermissionTypeLocalFonts enum const.
 95	BrowserPermissionTypeLocalFonts BrowserPermissionType = "localFonts"
 96
 97	// BrowserPermissionTypeMidi enum const.
 98	BrowserPermissionTypeMidi BrowserPermissionType = "midi"
 99
100	// BrowserPermissionTypeMidiSysex enum const.
101	BrowserPermissionTypeMidiSysex BrowserPermissionType = "midiSysex"
102
103	// BrowserPermissionTypeNfc enum const.
104	BrowserPermissionTypeNfc BrowserPermissionType = "nfc"
105
106	// BrowserPermissionTypeNotifications enum const.
107	BrowserPermissionTypeNotifications BrowserPermissionType = "notifications"
108
109	// BrowserPermissionTypePaymentHandler enum const.
110	BrowserPermissionTypePaymentHandler BrowserPermissionType = "paymentHandler"
111
112	// BrowserPermissionTypePeriodicBackgroundSync enum const.
113	BrowserPermissionTypePeriodicBackgroundSync BrowserPermissionType = "periodicBackgroundSync"
114
115	// BrowserPermissionTypeProtectedMediaIdentifier enum const.
116	BrowserPermissionTypeProtectedMediaIdentifier BrowserPermissionType = "protectedMediaIdentifier"
117
118	// BrowserPermissionTypeSensors enum const.
119	BrowserPermissionTypeSensors BrowserPermissionType = "sensors"
120
121	// BrowserPermissionTypeStorageAccess enum const.
122	BrowserPermissionTypeStorageAccess BrowserPermissionType = "storageAccess"
123
124	// BrowserPermissionTypeSpeakerSelection enum const.
125	BrowserPermissionTypeSpeakerSelection BrowserPermissionType = "speakerSelection"
126
127	// BrowserPermissionTypeTopLevelStorageAccess enum const.
128	BrowserPermissionTypeTopLevelStorageAccess BrowserPermissionType = "topLevelStorageAccess"
129
130	// BrowserPermissionTypeVideoCapture enum const.
131	BrowserPermissionTypeVideoCapture BrowserPermissionType = "videoCapture"
132
133	// BrowserPermissionTypeVideoCapturePanTiltZoom enum const.
134	BrowserPermissionTypeVideoCapturePanTiltZoom BrowserPermissionType = "videoCapturePanTiltZoom"
135
136	// BrowserPermissionTypeWakeLockScreen enum const.
137	BrowserPermissionTypeWakeLockScreen BrowserPermissionType = "wakeLockScreen"
138
139	// BrowserPermissionTypeWakeLockSystem enum const.
140	BrowserPermissionTypeWakeLockSystem BrowserPermissionType = "wakeLockSystem"
141
142	// BrowserPermissionTypeWindowManagement enum const.
143	BrowserPermissionTypeWindowManagement BrowserPermissionType = "windowManagement"
144)
145
146// BrowserPermissionSetting (experimental) ...
147type BrowserPermissionSetting string
148
149const (
150	// BrowserPermissionSettingGranted enum const.
151	BrowserPermissionSettingGranted BrowserPermissionSetting = "granted"
152
153	// BrowserPermissionSettingDenied enum const.
154	BrowserPermissionSettingDenied BrowserPermissionSetting = "denied"
155
156	// BrowserPermissionSettingPrompt enum const.
157	BrowserPermissionSettingPrompt BrowserPermissionSetting = "prompt"
158)
159
160// BrowserPermissionDescriptor (experimental) Definition of PermissionDescriptor defined in the Permissions API:
161// https://w3c.github.io/permissions/#dom-permissiondescriptor.
162type BrowserPermissionDescriptor struct {
163	// Name of permission.
164	// See https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/permissions/permission_descriptor.idl for valid permission names.
165	Name string `json:"name"`
166
167	// Sysex (optional) For "midi" permission, may also specify sysex control.
168	Sysex bool `json:"sysex,omitempty"`
169
170	// UserVisibleOnly (optional) For "push" permission, may specify userVisibleOnly.
171	// Note that userVisibleOnly = true is the only currently supported type.
172	UserVisibleOnly bool `json:"userVisibleOnly,omitempty"`
173
174	// AllowWithoutSanitization (optional) For "clipboard" permission, may specify allowWithoutSanitization.
175	AllowWithoutSanitization bool `json:"allowWithoutSanitization,omitempty"`
176
177	// AllowWithoutGesture (optional) For "fullscreen" permission, must specify allowWithoutGesture:true.
178	AllowWithoutGesture bool `json:"allowWithoutGesture,omitempty"`
179
180	// PanTiltZoom (optional) For "camera" permission, may specify panTiltZoom.
181	PanTiltZoom bool `json:"panTiltZoom,omitempty"`
182}
183
184// BrowserBrowserCommandID (experimental) Browser command ids used by executeBrowserCommand.
185type BrowserBrowserCommandID string
186
187const (
188	// BrowserBrowserCommandIDOpenTabSearch enum const.
189	BrowserBrowserCommandIDOpenTabSearch BrowserBrowserCommandID = "openTabSearch"
190
191	// BrowserBrowserCommandIDCloseTabSearch enum const.
192	BrowserBrowserCommandIDCloseTabSearch BrowserBrowserCommandID = "closeTabSearch"
193)
194
195// BrowserBucket (experimental) Chrome histogram bucket.
196type BrowserBucket struct {
197	// Low Minimum value (inclusive).
198	Low int `json:"low"`
199
200	// High Maximum value (exclusive).
201	High int `json:"high"`
202
203	// Count Number of samples.
204	Count int `json:"count"`
205}
206
207// BrowserHistogram (experimental) Chrome histogram.
208type BrowserHistogram struct {
209	// Name.
210	Name string `json:"name"`
211
212	// Sum of sample values.
213	Sum int `json:"sum"`
214
215	// Count Total number of samples.
216	Count int `json:"count"`
217
218	// Buckets.
219	Buckets []*BrowserBucket `json:"buckets"`
220}
221
222// BrowserSetPermission (experimental) Set permission settings for given origin.
223type BrowserSetPermission struct {
224	// Permission Descriptor of permission to override.
225	Permission *BrowserPermissionDescriptor `json:"permission"`
226
227	// Setting of the permission.
228	Setting BrowserPermissionSetting `json:"setting"`
229
230	// Origin (optional) Origin the permission applies to, all origins if not specified.
231	Origin string `json:"origin,omitempty"`
232
233	// BrowserContextID (optional) Context to override. When omitted, default browser context is used.
234	BrowserContextID BrowserBrowserContextID `json:"browserContextId,omitempty"`
235}
236
237// ProtoReq name.
238func (m BrowserSetPermission) ProtoReq() string { return "Browser.setPermission" }
239
240// Call sends the request.
241func (m BrowserSetPermission) Call(c Client) error {
242	return call(m.ProtoReq(), m, nil, c)
243}
244
245// BrowserGrantPermissions (experimental) Grant specific permissions to the given origin and reject all others.
246type BrowserGrantPermissions struct {
247	// Permissions ...
248	Permissions []BrowserPermissionType `json:"permissions"`
249
250	// Origin (optional) Origin the permission applies to, all origins if not specified.
251	Origin string `json:"origin,omitempty"`
252
253	// BrowserContextID (optional) BrowserContext to override permissions. When omitted, default browser context is used.
254	BrowserContextID BrowserBrowserContextID `json:"browserContextId,omitempty"`
255}
256
257// ProtoReq name.
258func (m BrowserGrantPermissions) ProtoReq() string { return "Browser.grantPermissions" }
259
260// Call sends the request.
261func (m BrowserGrantPermissions) Call(c Client) error {
262	return call(m.ProtoReq(), m, nil, c)
263}
264
265// BrowserResetPermissions Reset all permission management for all origins.
266type BrowserResetPermissions struct {
267	// BrowserContextID (optional) BrowserContext to reset permissions. When omitted, default browser context is used.
268	BrowserContextID BrowserBrowserContextID `json:"browserContextId,omitempty"`
269}
270
271// ProtoReq name.
272func (m BrowserResetPermissions) ProtoReq() string { return "Browser.resetPermissions" }
273
274// Call sends the request.
275func (m BrowserResetPermissions) Call(c Client) error {
276	return call(m.ProtoReq(), m, nil, c)
277}
278
279// BrowserSetDownloadBehaviorBehavior enum.
280type BrowserSetDownloadBehaviorBehavior string
281
282const (
283	// BrowserSetDownloadBehaviorBehaviorDeny enum const.
284	BrowserSetDownloadBehaviorBehaviorDeny BrowserSetDownloadBehaviorBehavior = "deny"
285
286	// BrowserSetDownloadBehaviorBehaviorAllow enum const.
287	BrowserSetDownloadBehaviorBehaviorAllow BrowserSetDownloadBehaviorBehavior = "allow"
288
289	// BrowserSetDownloadBehaviorBehaviorAllowAndName enum const.
290	BrowserSetDownloadBehaviorBehaviorAllowAndName BrowserSetDownloadBehaviorBehavior = "allowAndName"
291
292	// BrowserSetDownloadBehaviorBehaviorDefault enum const.
293	BrowserSetDownloadBehaviorBehaviorDefault BrowserSetDownloadBehaviorBehavior = "default"
294)
295
296// BrowserSetDownloadBehavior (experimental) Set the behavior when downloading a file.
297type BrowserSetDownloadBehavior struct {
298	// Behavior Whether to allow all or deny all download requests, or use default Chrome behavior if
299	// available (otherwise deny). |allowAndName| allows download and names files according to
300	// their download guids.
301	Behavior BrowserSetDownloadBehaviorBehavior `json:"behavior"`
302
303	// BrowserContextID (optional) BrowserContext to set download behavior. When omitted, default browser context is used.
304	BrowserContextID BrowserBrowserContextID `json:"browserContextId,omitempty"`
305
306	// DownloadPath (optional) The default path to save downloaded files to. This is required if behavior is set to 'allow'
307	// or 'allowAndName'.
308	DownloadPath string `json:"downloadPath,omitempty"`
309
310	// EventsEnabled (optional) Whether to emit download events (defaults to false).
311	EventsEnabled bool `json:"eventsEnabled,omitempty"`
312}
313
314// ProtoReq name.
315func (m BrowserSetDownloadBehavior) ProtoReq() string { return "Browser.setDownloadBehavior" }
316
317// Call sends the request.
318func (m BrowserSetDownloadBehavior) Call(c Client) error {
319	return call(m.ProtoReq(), m, nil, c)
320}
321
322// BrowserCancelDownload (experimental) Cancel a download if in progress.
323type BrowserCancelDownload struct {
324	// GUID Global unique identifier of the download.
325	GUID string `json:"guid"`
326
327	// BrowserContextID (optional) BrowserContext to perform the action in. When omitted, default browser context is used.
328	BrowserContextID BrowserBrowserContextID `json:"browserContextId,omitempty"`
329}
330
331// ProtoReq name.
332func (m BrowserCancelDownload) ProtoReq() string { return "Browser.cancelDownload" }
333
334// Call sends the request.
335func (m BrowserCancelDownload) Call(c Client) error {
336	return call(m.ProtoReq(), m, nil, c)
337}
338
339// BrowserClose Close browser gracefully.
340type BrowserClose struct{}
341
342// ProtoReq name.
343func (m BrowserClose) ProtoReq() string { return "Browser.close" }
344
345// Call sends the request.
346func (m BrowserClose) Call(c Client) error {
347	return call(m.ProtoReq(), m, nil, c)
348}
349
350// BrowserCrash (experimental) Crashes browser on the main thread.
351type BrowserCrash struct{}
352
353// ProtoReq name.
354func (m BrowserCrash) ProtoReq() string { return "Browser.crash" }
355
356// Call sends the request.
357func (m BrowserCrash) Call(c Client) error {
358	return call(m.ProtoReq(), m, nil, c)
359}
360
361// BrowserCrashGpuProcess (experimental) Crashes GPU process.
362type BrowserCrashGpuProcess struct{}
363
364// ProtoReq name.
365func (m BrowserCrashGpuProcess) ProtoReq() string { return "Browser.crashGpuProcess" }
366
367// Call sends the request.
368func (m BrowserCrashGpuProcess) Call(c Client) error {
369	return call(m.ProtoReq(), m, nil, c)
370}
371
372// BrowserGetVersion Returns version information.
373type BrowserGetVersion struct{}
374
375// ProtoReq name.
376func (m BrowserGetVersion) ProtoReq() string { return "Browser.getVersion" }
377
378// Call the request.
379func (m BrowserGetVersion) Call(c Client) (*BrowserGetVersionResult, error) {
380	var res BrowserGetVersionResult
381	return &res, call(m.ProtoReq(), m, &res, c)
382}
383
384// BrowserGetVersionResult ...
385type BrowserGetVersionResult struct {
386	// ProtocolVersion Protocol version.
387	ProtocolVersion string `json:"protocolVersion"`
388
389	// Product name.
390	Product string `json:"product"`
391
392	// Revision Product revision.
393	Revision string `json:"revision"`
394
395	// UserAgent User-Agent.
396	UserAgent string `json:"userAgent"`
397
398	// JsVersion V8 version.
399	JsVersion string `json:"jsVersion"`
400}
401
402// BrowserGetBrowserCommandLine (experimental) Returns the command line switches for the browser process if, and only if
403// --enable-automation is on the commandline.
404type BrowserGetBrowserCommandLine struct{}
405
406// ProtoReq name.
407func (m BrowserGetBrowserCommandLine) ProtoReq() string { return "Browser.getBrowserCommandLine" }
408
409// Call the request.
410func (m BrowserGetBrowserCommandLine) Call(c Client) (*BrowserGetBrowserCommandLineResult, error) {
411	var res BrowserGetBrowserCommandLineResult
412	return &res, call(m.ProtoReq(), m, &res, c)
413}
414
415// BrowserGetBrowserCommandLineResult (experimental) ...
416type BrowserGetBrowserCommandLineResult struct {
417	// Arguments Commandline parameters
418	Arguments []string `json:"arguments"`
419}
420
421// BrowserGetHistograms (experimental) Get Chrome histograms.
422type BrowserGetHistograms struct {
423	// Query (optional) Requested substring in name. Only histograms which have query as a
424	// substring in their name are extracted. An empty or absent query returns
425	// all histograms.
426	Query string `json:"query,omitempty"`
427
428	// Delta (optional) If true, retrieve delta since last delta call.
429	Delta bool `json:"delta,omitempty"`
430}
431
432// ProtoReq name.
433func (m BrowserGetHistograms) ProtoReq() string { return "Browser.getHistograms" }
434
435// Call the request.
436func (m BrowserGetHistograms) Call(c Client) (*BrowserGetHistogramsResult, error) {
437	var res BrowserGetHistogramsResult
438	return &res, call(m.ProtoReq(), m, &res, c)
439}
440
441// BrowserGetHistogramsResult (experimental) ...
442type BrowserGetHistogramsResult struct {
443	// Histograms.
444	Histograms []*BrowserHistogram `json:"histograms"`
445}
446
447// BrowserGetHistogram (experimental) Get a Chrome histogram by name.
448type BrowserGetHistogram struct {
449	// Name Requested histogram name.
450	Name string `json:"name"`
451
452	// Delta (optional) If true, retrieve delta since last delta call.
453	Delta bool `json:"delta,omitempty"`
454}
455
456// ProtoReq name.
457func (m BrowserGetHistogram) ProtoReq() string { return "Browser.getHistogram" }
458
459// Call the request.
460func (m BrowserGetHistogram) Call(c Client) (*BrowserGetHistogramResult, error) {
461	var res BrowserGetHistogramResult
462	return &res, call(m.ProtoReq(), m, &res, c)
463}
464
465// BrowserGetHistogramResult (experimental) ...
466type BrowserGetHistogramResult struct {
467	// Histogram.
468	Histogram *BrowserHistogram `json:"histogram"`
469}
470
471// BrowserGetWindowBounds (experimental) Get position and size of the browser window.
472type BrowserGetWindowBounds struct {
473	// WindowID Browser window id.
474	WindowID BrowserWindowID `json:"windowId"`
475}
476
477// ProtoReq name.
478func (m BrowserGetWindowBounds) ProtoReq() string { return "Browser.getWindowBounds" }
479
480// Call the request.
481func (m BrowserGetWindowBounds) Call(c Client) (*BrowserGetWindowBoundsResult, error) {
482	var res BrowserGetWindowBoundsResult
483	return &res, call(m.ProtoReq(), m, &res, c)
484}
485
486// BrowserGetWindowBoundsResult (experimental) ...
487type BrowserGetWindowBoundsResult struct {
488	// Bounds information of the window. When window state is 'minimized', the restored window
489	// position and size are returned.
490	Bounds *BrowserBounds `json:"bounds"`
491}
492
493// BrowserGetWindowForTarget (experimental) Get the browser window that contains the devtools target.
494type BrowserGetWindowForTarget struct {
495	// TargetID (optional) Devtools agent host id. If called as a part of the session, associated targetId is used.
496	TargetID TargetTargetID `json:"targetId,omitempty"`
497}
498
499// ProtoReq name.
500func (m BrowserGetWindowForTarget) ProtoReq() string { return "Browser.getWindowForTarget" }
501
502// Call the request.
503func (m BrowserGetWindowForTarget) Call(c Client) (*BrowserGetWindowForTargetResult, error) {
504	var res BrowserGetWindowForTargetResult
505	return &res, call(m.ProtoReq(), m, &res, c)
506}
507
508// BrowserGetWindowForTargetResult (experimental) ...
509type BrowserGetWindowForTargetResult struct {
510	// WindowID Browser window id.
511	WindowID BrowserWindowID `json:"windowId"`
512
513	// Bounds information of the window. When window state is 'minimized', the restored window
514	// position and size are returned.
515	Bounds *BrowserBounds `json:"bounds"`
516}
517
518// BrowserSetWindowBounds (experimental) Set position and/or size of the browser window.
519type BrowserSetWindowBounds struct {
520	// WindowID Browser window id.
521	WindowID BrowserWindowID `json:"windowId"`
522
523	// Bounds New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined
524	// with 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged.
525	Bounds *BrowserBounds `json:"bounds"`
526}
527
528// ProtoReq name.
529func (m BrowserSetWindowBounds) ProtoReq() string { return "Browser.setWindowBounds" }
530
531// Call sends the request.
532func (m BrowserSetWindowBounds) Call(c Client) error {
533	return call(m.ProtoReq(), m, nil, c)
534}
535
536// BrowserSetDockTile (experimental) Set dock tile details, platform-specific.
537type BrowserSetDockTile struct {
538	// BadgeLabel (optional) ...
539	BadgeLabel string `json:"badgeLabel,omitempty"`
540
541	// Image (optional) Png encoded image.
542	Image []byte `json:"image,omitempty"`
543}
544
545// ProtoReq name.
546func (m BrowserSetDockTile) ProtoReq() string { return "Browser.setDockTile" }
547
548// Call sends the request.
549func (m BrowserSetDockTile) Call(c Client) error {
550	return call(m.ProtoReq(), m, nil, c)
551}
552
553// BrowserExecuteBrowserCommand (experimental) Invoke custom browser commands used by telemetry.
554type BrowserExecuteBrowserCommand struct {
555	// CommandID ...
556	CommandID BrowserBrowserCommandID `json:"commandId"`
557}
558
559// ProtoReq name.
560func (m BrowserExecuteBrowserCommand) ProtoReq() string { return "Browser.executeBrowserCommand" }
561
562// Call sends the request.
563func (m BrowserExecuteBrowserCommand) Call(c Client) error {
564	return call(m.ProtoReq(), m, nil, c)
565}
566
567// BrowserAddPrivacySandboxEnrollmentOverride Allows a site to use privacy sandbox features that require enrollment
568// without the site actually being enrolled. Only supported on page targets.
569type BrowserAddPrivacySandboxEnrollmentOverride struct {
570	// URL ...
571	URL string `json:"url"`
572}
573
574// ProtoReq name.
575func (m BrowserAddPrivacySandboxEnrollmentOverride) ProtoReq() string {
576	return "Browser.addPrivacySandboxEnrollmentOverride"
577}
578
579// Call sends the request.
580func (m BrowserAddPrivacySandboxEnrollmentOverride) Call(c Client) error {
581	return call(m.ProtoReq(), m, nil, c)
582}
583
584// BrowserDownloadWillBegin (experimental) Fired when page is about to start a download.
585type BrowserDownloadWillBegin struct {
586	// FrameID Id of the frame that caused the download to begin.
587	FrameID PageFrameID `json:"frameId"`
588
589	// GUID Global unique identifier of the download.
590	GUID string `json:"guid"`
591
592	// URL of the resource being downloaded.
593	URL string `json:"url"`
594
595	// SuggestedFilename Suggested file name of the resource (the actual name of the file saved on disk may differ).
596	SuggestedFilename string `json:"suggestedFilename"`
597}
598
599// ProtoEvent name.
600func (evt BrowserDownloadWillBegin) ProtoEvent() string {
601	return "Browser.downloadWillBegin"
602}
603
604// BrowserDownloadProgressState enum.
605type BrowserDownloadProgressState string
606
607const (
608	// BrowserDownloadProgressStateInProgress enum const.
609	BrowserDownloadProgressStateInProgress BrowserDownloadProgressState = "inProgress"
610
611	// BrowserDownloadProgressStateCompleted enum const.
612	BrowserDownloadProgressStateCompleted BrowserDownloadProgressState = "completed"
613
614	// BrowserDownloadProgressStateCanceled enum const.
615	BrowserDownloadProgressStateCanceled BrowserDownloadProgressState = "canceled"
616)
617
618// BrowserDownloadProgress (experimental) Fired when download makes progress. Last call has |done| == true.
619type BrowserDownloadProgress struct {
620	// GUID Global unique identifier of the download.
621	GUID string `json:"guid"`
622
623	// TotalBytes Total expected bytes to download.
624	TotalBytes float64 `json:"totalBytes"`
625
626	// ReceivedBytes Total bytes received.
627	ReceivedBytes float64 `json:"receivedBytes"`
628
629	// State Download status.
630	State BrowserDownloadProgressState `json:"state"`
631}
632
633// ProtoEvent name.
634func (evt BrowserDownloadProgress) ProtoEvent() string {
635	return "Browser.downloadProgress"
636}