events.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. package page
  2. // Code generated by cdproto-gen. DO NOT EDIT.
  3. import (
  4. "github.com/chromedp/cdproto/cdp"
  5. "github.com/chromedp/cdproto/runtime"
  6. )
  7. // EventDomContentEventFired [no description].
  8. //
  9. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-domContentEventFired
  10. type EventDomContentEventFired struct {
  11. Timestamp *cdp.MonotonicTime `json:"timestamp"`
  12. }
  13. // EventFileChooserOpened emitted only when page.interceptFileChooser is
  14. // enabled.
  15. //
  16. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-fileChooserOpened
  17. type EventFileChooserOpened struct {
  18. FrameID cdp.FrameID `json:"frameId"` // Id of the frame containing input node.
  19. Mode FileChooserOpenedMode `json:"mode"` // Input mode.
  20. BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty,omitzero"` // Input node id. Only present for file choosers opened via an <input type="file"> element.
  21. }
  22. // EventFrameAttached fired when frame has been attached to its parent.
  23. //
  24. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-frameAttached
  25. type EventFrameAttached struct {
  26. FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has been attached.
  27. ParentFrameID cdp.FrameID `json:"parentFrameId"` // Parent frame identifier.
  28. Stack *runtime.StackTrace `json:"stack,omitempty,omitzero"` // JavaScript stack trace of when frame was attached, only set if frame initiated from script.
  29. }
  30. // EventFrameDetached fired when frame has been detached from its parent.
  31. //
  32. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-frameDetached
  33. type EventFrameDetached struct {
  34. FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has been detached.
  35. Reason FrameDetachedReason `json:"reason"`
  36. }
  37. // EventFrameSubtreeWillBeDetached fired before frame subtree is detached.
  38. // Emitted before any frame of the subtree is actually detached.
  39. //
  40. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-frameSubtreeWillBeDetached
  41. type EventFrameSubtreeWillBeDetached struct {
  42. FrameID cdp.FrameID `json:"frameId"` // Id of the frame that is the root of the subtree that will be detached.
  43. }
  44. // EventFrameNavigated fired once navigation of the frame has completed.
  45. // Frame is now associated with the new loader.
  46. //
  47. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-frameNavigated
  48. type EventFrameNavigated struct {
  49. Frame *cdp.Frame `json:"frame"` // Frame object.
  50. Type NavigationType `json:"type"`
  51. }
  52. // EventDocumentOpened fired when opening document to write to.
  53. //
  54. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-documentOpened
  55. type EventDocumentOpened struct {
  56. Frame *cdp.Frame `json:"frame"` // Frame object.
  57. }
  58. // EventFrameResized [no description].
  59. //
  60. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-frameResized
  61. type EventFrameResized struct{}
  62. // EventFrameStartedNavigating fired when a navigation starts. This event is
  63. // fired for both renderer-initiated and browser-initiated navigations. For
  64. // renderer-initiated navigations, the event is fired after
  65. // frameRequestedNavigation. Navigation may still be cancelled after the event
  66. // is issued. Multiple events can be fired for a single navigation, for example,
  67. // when a same-document navigation becomes a cross-document navigation (such as
  68. // in the case of a frameset).
  69. //
  70. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-frameStartedNavigating
  71. type EventFrameStartedNavigating struct {
  72. FrameID cdp.FrameID `json:"frameId"` // ID of the frame that is being navigated.
  73. URL string `json:"url"` // The URL the navigation started with. The final URL can be different.
  74. LoaderID cdp.LoaderID `json:"loaderId"` // Loader identifier. Even though it is present in case of same-document navigation, the previously committed loaderId would not change unless the navigation changes from a same-document to a cross-document navigation.
  75. NavigationType FrameStartedNavigatingNavigationType `json:"navigationType"`
  76. }
  77. // EventFrameRequestedNavigation fired when a renderer-initiated navigation
  78. // is requested. Navigation may still be cancelled after the event is issued.
  79. //
  80. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-frameRequestedNavigation
  81. type EventFrameRequestedNavigation struct {
  82. FrameID cdp.FrameID `json:"frameId"` // Id of the frame that is being navigated.
  83. Reason ClientNavigationReason `json:"reason"` // The reason for the navigation.
  84. URL string `json:"url"` // The destination URL for the requested navigation.
  85. Disposition ClientNavigationDisposition `json:"disposition"` // The disposition for the navigation.
  86. }
  87. // EventFrameStartedLoading fired when frame has started loading.
  88. //
  89. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-frameStartedLoading
  90. type EventFrameStartedLoading struct {
  91. FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has started loading.
  92. }
  93. // EventFrameStoppedLoading fired when frame has stopped loading.
  94. //
  95. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-frameStoppedLoading
  96. type EventFrameStoppedLoading struct {
  97. FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has stopped loading.
  98. }
  99. // EventInterstitialHidden fired when interstitial page was hidden.
  100. //
  101. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-interstitialHidden
  102. type EventInterstitialHidden struct{}
  103. // EventInterstitialShown fired when interstitial page was shown.
  104. //
  105. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-interstitialShown
  106. type EventInterstitialShown struct{}
  107. // EventJavascriptDialogClosed fired when a JavaScript initiated dialog
  108. // (alert, confirm, prompt, or onbeforeunload) has been closed.
  109. //
  110. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-javascriptDialogClosed
  111. type EventJavascriptDialogClosed struct {
  112. Result bool `json:"result"` // Whether dialog was confirmed.
  113. UserInput string `json:"userInput"` // User input in case of prompt.
  114. }
  115. // EventJavascriptDialogOpening fired when a JavaScript initiated dialog
  116. // (alert, confirm, prompt, or onbeforeunload) is about to open.
  117. //
  118. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-javascriptDialogOpening
  119. type EventJavascriptDialogOpening struct {
  120. URL string `json:"url"` // Frame url.
  121. Message string `json:"message"` // Message that will be displayed by the dialog.
  122. Type DialogType `json:"type"` // Dialog type.
  123. HasBrowserHandler bool `json:"hasBrowserHandler"` // True iff browser is capable showing or acting on the given dialog. When browser has no dialog handler for given target, calling alert while Page domain is engaged will stall the page execution. Execution can be resumed via calling Page.handleJavaScriptDialog.
  124. DefaultPrompt string `json:"defaultPrompt,omitempty,omitzero"` // Default dialog prompt.
  125. }
  126. // EventLifecycleEvent fired for lifecycle events (navigation, load, paint,
  127. // etc) in the current target (including local frames).
  128. //
  129. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-lifecycleEvent
  130. type EventLifecycleEvent struct {
  131. FrameID cdp.FrameID `json:"frameId"` // Id of the frame.
  132. LoaderID cdp.LoaderID `json:"loaderId"` // Loader identifier. Empty string if the request is fetched from worker.
  133. Name string `json:"name"`
  134. Timestamp *cdp.MonotonicTime `json:"timestamp"`
  135. }
  136. // EventBackForwardCacheNotUsed fired for failed bfcache history navigations
  137. // if BackForwardCache feature is enabled. Do not assume any ordering with the
  138. // Page.frameNavigated event. This event is fired only for main-frame history
  139. // navigation where the document changes (non-same-document navigations), when
  140. // bfcache navigation fails.
  141. //
  142. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-backForwardCacheNotUsed
  143. type EventBackForwardCacheNotUsed struct {
  144. LoaderID cdp.LoaderID `json:"loaderId"` // The loader id for the associated navigation.
  145. FrameID cdp.FrameID `json:"frameId"` // The frame id of the associated frame.
  146. NotRestoredExplanations []*BackForwardCacheNotRestoredExplanation `json:"notRestoredExplanations"` // Array of reasons why the page could not be cached. This must not be empty.
  147. NotRestoredExplanationsTree *BackForwardCacheNotRestoredExplanationTree `json:"notRestoredExplanationsTree,omitempty,omitzero"` // Tree structure of reasons why the page could not be cached for each frame.
  148. }
  149. // EventLoadEventFired [no description].
  150. //
  151. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-loadEventFired
  152. type EventLoadEventFired struct {
  153. Timestamp *cdp.MonotonicTime `json:"timestamp"`
  154. }
  155. // EventNavigatedWithinDocument fired when same-document navigation happens,
  156. // e.g. due to history API usage or anchor navigation.
  157. //
  158. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-navigatedWithinDocument
  159. type EventNavigatedWithinDocument struct {
  160. FrameID cdp.FrameID `json:"frameId"` // Id of the frame.
  161. URL string `json:"url"` // Frame's new url.
  162. NavigationType NavigatedWithinDocumentNavigationType `json:"navigationType"` // Navigation type
  163. }
  164. // EventScreencastFrame compressed image data requested by the
  165. // startScreencast.
  166. //
  167. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-screencastFrame
  168. type EventScreencastFrame struct {
  169. Data string `json:"data"` // Base64-encoded compressed image.
  170. Metadata *ScreencastFrameMetadata `json:"metadata"` // Screencast frame metadata.
  171. SessionID int64 `json:"sessionId"` // Frame number.
  172. }
  173. // EventScreencastVisibilityChanged fired when the page with currently
  174. // enabled screencast was shown or hidden .
  175. //
  176. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-screencastVisibilityChanged
  177. type EventScreencastVisibilityChanged struct {
  178. Visible bool `json:"visible"` // True if the page is visible.
  179. }
  180. // EventWindowOpen fired when a new window is going to be opened, via
  181. // window.open(), link click, form submission, etc.
  182. //
  183. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-windowOpen
  184. type EventWindowOpen struct {
  185. URL string `json:"url"` // The URL for the new window.
  186. WindowName string `json:"windowName"` // Window name.
  187. WindowFeatures []string `json:"windowFeatures"` // An array of enabled window features.
  188. UserGesture bool `json:"userGesture"` // Whether or not it was triggered by user gesture.
  189. }
  190. // EventCompilationCacheProduced issued for every compilation cache
  191. // generated. Is only available if Page.setGenerateCompilationCache is enabled.
  192. //
  193. // See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-compilationCacheProduced
  194. type EventCompilationCacheProduced struct {
  195. URL string `json:"url"`
  196. Data string `json:"data"` // Base64-encoded data
  197. }