emulation.go 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002
  1. // Package emulation provides the Chrome DevTools Protocol
  2. // commands, types, and events for the Emulation domain.
  3. //
  4. // This domain emulates different environments for the page.
  5. //
  6. // Generated by the cdproto-gen command.
  7. package emulation
  8. // Code generated by cdproto-gen. DO NOT EDIT.
  9. import (
  10. "context"
  11. "github.com/chromedp/cdproto/cdp"
  12. "github.com/chromedp/cdproto/page"
  13. )
  14. // ClearDeviceMetricsOverrideParams clears the overridden device metrics.
  15. type ClearDeviceMetricsOverrideParams struct{}
  16. // ClearDeviceMetricsOverride clears the overridden device metrics.
  17. //
  18. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-clearDeviceMetricsOverride
  19. func ClearDeviceMetricsOverride() *ClearDeviceMetricsOverrideParams {
  20. return &ClearDeviceMetricsOverrideParams{}
  21. }
  22. // Do executes Emulation.clearDeviceMetricsOverride against the provided context.
  23. func (p *ClearDeviceMetricsOverrideParams) Do(ctx context.Context) (err error) {
  24. return cdp.Execute(ctx, CommandClearDeviceMetricsOverride, nil, nil)
  25. }
  26. // ClearGeolocationOverrideParams clears the overridden Geolocation Position
  27. // and Error.
  28. type ClearGeolocationOverrideParams struct{}
  29. // ClearGeolocationOverride clears the overridden Geolocation Position and
  30. // Error.
  31. //
  32. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-clearGeolocationOverride
  33. func ClearGeolocationOverride() *ClearGeolocationOverrideParams {
  34. return &ClearGeolocationOverrideParams{}
  35. }
  36. // Do executes Emulation.clearGeolocationOverride against the provided context.
  37. func (p *ClearGeolocationOverrideParams) Do(ctx context.Context) (err error) {
  38. return cdp.Execute(ctx, CommandClearGeolocationOverride, nil, nil)
  39. }
  40. // ResetPageScaleFactorParams requests that page scale factor is reset to
  41. // initial values.
  42. type ResetPageScaleFactorParams struct{}
  43. // ResetPageScaleFactor requests that page scale factor is reset to initial
  44. // values.
  45. //
  46. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-resetPageScaleFactor
  47. func ResetPageScaleFactor() *ResetPageScaleFactorParams {
  48. return &ResetPageScaleFactorParams{}
  49. }
  50. // Do executes Emulation.resetPageScaleFactor against the provided context.
  51. func (p *ResetPageScaleFactorParams) Do(ctx context.Context) (err error) {
  52. return cdp.Execute(ctx, CommandResetPageScaleFactor, nil, nil)
  53. }
  54. // SetFocusEmulationEnabledParams enables or disables simulating a focused
  55. // and active page.
  56. type SetFocusEmulationEnabledParams struct {
  57. Enabled bool `json:"enabled"` // Whether to enable to disable focus emulation.
  58. }
  59. // SetFocusEmulationEnabled enables or disables simulating a focused and
  60. // active page.
  61. //
  62. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setFocusEmulationEnabled
  63. //
  64. // parameters:
  65. //
  66. // enabled - Whether to enable to disable focus emulation.
  67. func SetFocusEmulationEnabled(enabled bool) *SetFocusEmulationEnabledParams {
  68. return &SetFocusEmulationEnabledParams{
  69. Enabled: enabled,
  70. }
  71. }
  72. // Do executes Emulation.setFocusEmulationEnabled against the provided context.
  73. func (p *SetFocusEmulationEnabledParams) Do(ctx context.Context) (err error) {
  74. return cdp.Execute(ctx, CommandSetFocusEmulationEnabled, p, nil)
  75. }
  76. // SetAutoDarkModeOverrideParams automatically render all web contents using
  77. // a dark theme.
  78. type SetAutoDarkModeOverrideParams struct {
  79. Enabled bool `json:"enabled,omitempty"` // Whether to enable or disable automatic dark mode. If not specified, any existing override will be cleared.
  80. }
  81. // SetAutoDarkModeOverride automatically render all web contents using a dark
  82. // theme.
  83. //
  84. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setAutoDarkModeOverride
  85. //
  86. // parameters:
  87. func SetAutoDarkModeOverride() *SetAutoDarkModeOverrideParams {
  88. return &SetAutoDarkModeOverrideParams{}
  89. }
  90. // WithEnabled whether to enable or disable automatic dark mode. If not
  91. // specified, any existing override will be cleared.
  92. func (p SetAutoDarkModeOverrideParams) WithEnabled(enabled bool) *SetAutoDarkModeOverrideParams {
  93. p.Enabled = enabled
  94. return &p
  95. }
  96. // Do executes Emulation.setAutoDarkModeOverride against the provided context.
  97. func (p *SetAutoDarkModeOverrideParams) Do(ctx context.Context) (err error) {
  98. return cdp.Execute(ctx, CommandSetAutoDarkModeOverride, p, nil)
  99. }
  100. // SetCPUThrottlingRateParams enables CPU throttling to emulate slow CPUs.
  101. type SetCPUThrottlingRateParams struct {
  102. Rate float64 `json:"rate"` // Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).
  103. }
  104. // SetCPUThrottlingRate enables CPU throttling to emulate slow CPUs.
  105. //
  106. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setCPUThrottlingRate
  107. //
  108. // parameters:
  109. //
  110. // rate - Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).
  111. func SetCPUThrottlingRate(rate float64) *SetCPUThrottlingRateParams {
  112. return &SetCPUThrottlingRateParams{
  113. Rate: rate,
  114. }
  115. }
  116. // Do executes Emulation.setCPUThrottlingRate against the provided context.
  117. func (p *SetCPUThrottlingRateParams) Do(ctx context.Context) (err error) {
  118. return cdp.Execute(ctx, CommandSetCPUThrottlingRate, p, nil)
  119. }
  120. // SetDefaultBackgroundColorOverrideParams sets or clears an override of the
  121. // default background color of the frame. This override is used if the content
  122. // does not specify one.
  123. type SetDefaultBackgroundColorOverrideParams struct {
  124. Color *cdp.RGBA `json:"color,omitempty"` // RGBA of the default background color. If not specified, any existing override will be cleared.
  125. }
  126. // SetDefaultBackgroundColorOverride sets or clears an override of the
  127. // default background color of the frame. This override is used if the content
  128. // does not specify one.
  129. //
  130. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDefaultBackgroundColorOverride
  131. //
  132. // parameters:
  133. func SetDefaultBackgroundColorOverride() *SetDefaultBackgroundColorOverrideParams {
  134. return &SetDefaultBackgroundColorOverrideParams{}
  135. }
  136. // WithColor rGBA of the default background color. If not specified, any
  137. // existing override will be cleared.
  138. func (p SetDefaultBackgroundColorOverrideParams) WithColor(color *cdp.RGBA) *SetDefaultBackgroundColorOverrideParams {
  139. p.Color = color
  140. return &p
  141. }
  142. // Do executes Emulation.setDefaultBackgroundColorOverride against the provided context.
  143. func (p *SetDefaultBackgroundColorOverrideParams) Do(ctx context.Context) (err error) {
  144. return cdp.Execute(ctx, CommandSetDefaultBackgroundColorOverride, p, nil)
  145. }
  146. // SetDeviceMetricsOverrideParams overrides the values of device screen
  147. // dimensions (window.screen.width, window.screen.height, window.innerWidth,
  148. // window.innerHeight, and "device-width"/"device-height"-related CSS media
  149. // query results).
  150. type SetDeviceMetricsOverrideParams struct {
  151. Width int64 `json:"width"` // Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
  152. Height int64 `json:"height"` // Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
  153. DeviceScaleFactor float64 `json:"deviceScaleFactor"` // Overriding device scale factor value. 0 disables the override.
  154. Mobile bool `json:"mobile"` // Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
  155. Scale float64 `json:"scale,omitempty"` // Scale to apply to resulting view image.
  156. ScreenWidth int64 `json:"screenWidth,omitempty"` // Overriding screen width value in pixels (minimum 0, maximum 10000000).
  157. ScreenHeight int64 `json:"screenHeight,omitempty"` // Overriding screen height value in pixels (minimum 0, maximum 10000000).
  158. PositionX int64 `json:"positionX,omitempty"` // Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
  159. PositionY int64 `json:"positionY,omitempty"` // Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
  160. DontSetVisibleSize bool `json:"dontSetVisibleSize,omitempty"` // Do not set visible view size, rely upon explicit setVisibleSize call.
  161. ScreenOrientation *ScreenOrientation `json:"screenOrientation,omitempty"` // Screen orientation override.
  162. Viewport *page.Viewport `json:"viewport,omitempty"` // If set, the visible area of the page will be overridden to this viewport. This viewport change is not observed by the page, e.g. viewport-relative elements do not change positions.
  163. DisplayFeature *DisplayFeature `json:"displayFeature,omitempty"` // If set, the display feature of a multi-segment screen. If not set, multi-segment support is turned-off.
  164. }
  165. // SetDeviceMetricsOverride overrides the values of device screen dimensions
  166. // (window.screen.width, window.screen.height, window.innerWidth,
  167. // window.innerHeight, and "device-width"/"device-height"-related CSS media
  168. // query results).
  169. //
  170. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDeviceMetricsOverride
  171. //
  172. // parameters:
  173. //
  174. // width - Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
  175. // height - Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
  176. // deviceScaleFactor - Overriding device scale factor value. 0 disables the override.
  177. // mobile - Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
  178. func SetDeviceMetricsOverride(width int64, height int64, deviceScaleFactor float64, mobile bool) *SetDeviceMetricsOverrideParams {
  179. return &SetDeviceMetricsOverrideParams{
  180. Width: width,
  181. Height: height,
  182. DeviceScaleFactor: deviceScaleFactor,
  183. Mobile: mobile,
  184. }
  185. }
  186. // WithScale scale to apply to resulting view image.
  187. func (p SetDeviceMetricsOverrideParams) WithScale(scale float64) *SetDeviceMetricsOverrideParams {
  188. p.Scale = scale
  189. return &p
  190. }
  191. // WithScreenWidth overriding screen width value in pixels (minimum 0,
  192. // maximum 10000000).
  193. func (p SetDeviceMetricsOverrideParams) WithScreenWidth(screenWidth int64) *SetDeviceMetricsOverrideParams {
  194. p.ScreenWidth = screenWidth
  195. return &p
  196. }
  197. // WithScreenHeight overriding screen height value in pixels (minimum 0,
  198. // maximum 10000000).
  199. func (p SetDeviceMetricsOverrideParams) WithScreenHeight(screenHeight int64) *SetDeviceMetricsOverrideParams {
  200. p.ScreenHeight = screenHeight
  201. return &p
  202. }
  203. // WithPositionX overriding view X position on screen in pixels (minimum 0,
  204. // maximum 10000000).
  205. func (p SetDeviceMetricsOverrideParams) WithPositionX(positionX int64) *SetDeviceMetricsOverrideParams {
  206. p.PositionX = positionX
  207. return &p
  208. }
  209. // WithPositionY overriding view Y position on screen in pixels (minimum 0,
  210. // maximum 10000000).
  211. func (p SetDeviceMetricsOverrideParams) WithPositionY(positionY int64) *SetDeviceMetricsOverrideParams {
  212. p.PositionY = positionY
  213. return &p
  214. }
  215. // WithDontSetVisibleSize do not set visible view size, rely upon explicit
  216. // setVisibleSize call.
  217. func (p SetDeviceMetricsOverrideParams) WithDontSetVisibleSize(dontSetVisibleSize bool) *SetDeviceMetricsOverrideParams {
  218. p.DontSetVisibleSize = dontSetVisibleSize
  219. return &p
  220. }
  221. // WithScreenOrientation screen orientation override.
  222. func (p SetDeviceMetricsOverrideParams) WithScreenOrientation(screenOrientation *ScreenOrientation) *SetDeviceMetricsOverrideParams {
  223. p.ScreenOrientation = screenOrientation
  224. return &p
  225. }
  226. // WithViewport if set, the visible area of the page will be overridden to
  227. // this viewport. This viewport change is not observed by the page, e.g.
  228. // viewport-relative elements do not change positions.
  229. func (p SetDeviceMetricsOverrideParams) WithViewport(viewport *page.Viewport) *SetDeviceMetricsOverrideParams {
  230. p.Viewport = viewport
  231. return &p
  232. }
  233. // WithDisplayFeature if set, the display feature of a multi-segment screen.
  234. // If not set, multi-segment support is turned-off.
  235. func (p SetDeviceMetricsOverrideParams) WithDisplayFeature(displayFeature *DisplayFeature) *SetDeviceMetricsOverrideParams {
  236. p.DisplayFeature = displayFeature
  237. return &p
  238. }
  239. // Do executes Emulation.setDeviceMetricsOverride against the provided context.
  240. func (p *SetDeviceMetricsOverrideParams) Do(ctx context.Context) (err error) {
  241. return cdp.Execute(ctx, CommandSetDeviceMetricsOverride, p, nil)
  242. }
  243. // SetDevicePostureOverrideParams start reporting the given posture value to
  244. // the Device Posture API. This override can also be set in
  245. // setDeviceMetricsOverride().
  246. type SetDevicePostureOverrideParams struct {
  247. Posture *DevicePosture `json:"posture"`
  248. }
  249. // SetDevicePostureOverride start reporting the given posture value to the
  250. // Device Posture API. This override can also be set in
  251. // setDeviceMetricsOverride().
  252. //
  253. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDevicePostureOverride
  254. //
  255. // parameters:
  256. //
  257. // posture
  258. func SetDevicePostureOverride(posture *DevicePosture) *SetDevicePostureOverrideParams {
  259. return &SetDevicePostureOverrideParams{
  260. Posture: posture,
  261. }
  262. }
  263. // Do executes Emulation.setDevicePostureOverride against the provided context.
  264. func (p *SetDevicePostureOverrideParams) Do(ctx context.Context) (err error) {
  265. return cdp.Execute(ctx, CommandSetDevicePostureOverride, p, nil)
  266. }
  267. // ClearDevicePostureOverrideParams clears a device posture override set with
  268. // either setDeviceMetricsOverride() or setDevicePostureOverride() and starts
  269. // using posture information from the platform again. Does nothing if no
  270. // override is set.
  271. type ClearDevicePostureOverrideParams struct{}
  272. // ClearDevicePostureOverride clears a device posture override set with
  273. // either setDeviceMetricsOverride() or setDevicePostureOverride() and starts
  274. // using posture information from the platform again. Does nothing if no
  275. // override is set.
  276. //
  277. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-clearDevicePostureOverride
  278. func ClearDevicePostureOverride() *ClearDevicePostureOverrideParams {
  279. return &ClearDevicePostureOverrideParams{}
  280. }
  281. // Do executes Emulation.clearDevicePostureOverride against the provided context.
  282. func (p *ClearDevicePostureOverrideParams) Do(ctx context.Context) (err error) {
  283. return cdp.Execute(ctx, CommandClearDevicePostureOverride, nil, nil)
  284. }
  285. // SetScrollbarsHiddenParams [no description].
  286. type SetScrollbarsHiddenParams struct {
  287. Hidden bool `json:"hidden"` // Whether scrollbars should be always hidden.
  288. }
  289. // SetScrollbarsHidden [no description].
  290. //
  291. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setScrollbarsHidden
  292. //
  293. // parameters:
  294. //
  295. // hidden - Whether scrollbars should be always hidden.
  296. func SetScrollbarsHidden(hidden bool) *SetScrollbarsHiddenParams {
  297. return &SetScrollbarsHiddenParams{
  298. Hidden: hidden,
  299. }
  300. }
  301. // Do executes Emulation.setScrollbarsHidden against the provided context.
  302. func (p *SetScrollbarsHiddenParams) Do(ctx context.Context) (err error) {
  303. return cdp.Execute(ctx, CommandSetScrollbarsHidden, p, nil)
  304. }
  305. // SetDocumentCookieDisabledParams [no description].
  306. type SetDocumentCookieDisabledParams struct {
  307. Disabled bool `json:"disabled"` // Whether document.coookie API should be disabled.
  308. }
  309. // SetDocumentCookieDisabled [no description].
  310. //
  311. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDocumentCookieDisabled
  312. //
  313. // parameters:
  314. //
  315. // disabled - Whether document.coookie API should be disabled.
  316. func SetDocumentCookieDisabled(disabled bool) *SetDocumentCookieDisabledParams {
  317. return &SetDocumentCookieDisabledParams{
  318. Disabled: disabled,
  319. }
  320. }
  321. // Do executes Emulation.setDocumentCookieDisabled against the provided context.
  322. func (p *SetDocumentCookieDisabledParams) Do(ctx context.Context) (err error) {
  323. return cdp.Execute(ctx, CommandSetDocumentCookieDisabled, p, nil)
  324. }
  325. // SetEmitTouchEventsForMouseParams [no description].
  326. type SetEmitTouchEventsForMouseParams struct {
  327. Enabled bool `json:"enabled"` // Whether touch emulation based on mouse input should be enabled.
  328. Configuration SetEmitTouchEventsForMouseConfiguration `json:"configuration,omitempty"` // Touch/gesture events configuration. Default: current platform.
  329. }
  330. // SetEmitTouchEventsForMouse [no description].
  331. //
  332. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setEmitTouchEventsForMouse
  333. //
  334. // parameters:
  335. //
  336. // enabled - Whether touch emulation based on mouse input should be enabled.
  337. func SetEmitTouchEventsForMouse(enabled bool) *SetEmitTouchEventsForMouseParams {
  338. return &SetEmitTouchEventsForMouseParams{
  339. Enabled: enabled,
  340. }
  341. }
  342. // WithConfiguration touch/gesture events configuration. Default: current
  343. // platform.
  344. func (p SetEmitTouchEventsForMouseParams) WithConfiguration(configuration SetEmitTouchEventsForMouseConfiguration) *SetEmitTouchEventsForMouseParams {
  345. p.Configuration = configuration
  346. return &p
  347. }
  348. // Do executes Emulation.setEmitTouchEventsForMouse against the provided context.
  349. func (p *SetEmitTouchEventsForMouseParams) Do(ctx context.Context) (err error) {
  350. return cdp.Execute(ctx, CommandSetEmitTouchEventsForMouse, p, nil)
  351. }
  352. // SetEmulatedMediaParams emulates the given media type or media feature for
  353. // CSS media queries.
  354. type SetEmulatedMediaParams struct {
  355. Media string `json:"media,omitempty"` // Media type to emulate. Empty string disables the override.
  356. Features []*MediaFeature `json:"features,omitempty"` // Media features to emulate.
  357. }
  358. // SetEmulatedMedia emulates the given media type or media feature for CSS
  359. // media queries.
  360. //
  361. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setEmulatedMedia
  362. //
  363. // parameters:
  364. func SetEmulatedMedia() *SetEmulatedMediaParams {
  365. return &SetEmulatedMediaParams{}
  366. }
  367. // WithMedia media type to emulate. Empty string disables the override.
  368. func (p SetEmulatedMediaParams) WithMedia(media string) *SetEmulatedMediaParams {
  369. p.Media = media
  370. return &p
  371. }
  372. // WithFeatures media features to emulate.
  373. func (p SetEmulatedMediaParams) WithFeatures(features []*MediaFeature) *SetEmulatedMediaParams {
  374. p.Features = features
  375. return &p
  376. }
  377. // Do executes Emulation.setEmulatedMedia against the provided context.
  378. func (p *SetEmulatedMediaParams) Do(ctx context.Context) (err error) {
  379. return cdp.Execute(ctx, CommandSetEmulatedMedia, p, nil)
  380. }
  381. // SetEmulatedVisionDeficiencyParams emulates the given vision deficiency.
  382. type SetEmulatedVisionDeficiencyParams struct {
  383. Type SetEmulatedVisionDeficiencyType `json:"type"` // Vision deficiency to emulate. Order: best-effort emulations come first, followed by any physiologically accurate emulations for medically recognized color vision deficiencies.
  384. }
  385. // SetEmulatedVisionDeficiency emulates the given vision deficiency.
  386. //
  387. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setEmulatedVisionDeficiency
  388. //
  389. // parameters:
  390. //
  391. // type - Vision deficiency to emulate. Order: best-effort emulations come first, followed by any physiologically accurate emulations for medically recognized color vision deficiencies.
  392. func SetEmulatedVisionDeficiency(typeVal SetEmulatedVisionDeficiencyType) *SetEmulatedVisionDeficiencyParams {
  393. return &SetEmulatedVisionDeficiencyParams{
  394. Type: typeVal,
  395. }
  396. }
  397. // Do executes Emulation.setEmulatedVisionDeficiency against the provided context.
  398. func (p *SetEmulatedVisionDeficiencyParams) Do(ctx context.Context) (err error) {
  399. return cdp.Execute(ctx, CommandSetEmulatedVisionDeficiency, p, nil)
  400. }
  401. // SetGeolocationOverrideParams overrides the Geolocation Position or Error.
  402. // Omitting any of the parameters emulates position unavailable.
  403. type SetGeolocationOverrideParams struct {
  404. Latitude float64 `json:"latitude,omitempty"` // Mock latitude
  405. Longitude float64 `json:"longitude,omitempty"` // Mock longitude
  406. Accuracy float64 `json:"accuracy,omitempty"` // Mock accuracy
  407. }
  408. // SetGeolocationOverride overrides the Geolocation Position or Error.
  409. // Omitting any of the parameters emulates position unavailable.
  410. //
  411. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setGeolocationOverride
  412. //
  413. // parameters:
  414. func SetGeolocationOverride() *SetGeolocationOverrideParams {
  415. return &SetGeolocationOverrideParams{}
  416. }
  417. // WithLatitude mock latitude.
  418. func (p SetGeolocationOverrideParams) WithLatitude(latitude float64) *SetGeolocationOverrideParams {
  419. p.Latitude = latitude
  420. return &p
  421. }
  422. // WithLongitude mock longitude.
  423. func (p SetGeolocationOverrideParams) WithLongitude(longitude float64) *SetGeolocationOverrideParams {
  424. p.Longitude = longitude
  425. return &p
  426. }
  427. // WithAccuracy mock accuracy.
  428. func (p SetGeolocationOverrideParams) WithAccuracy(accuracy float64) *SetGeolocationOverrideParams {
  429. p.Accuracy = accuracy
  430. return &p
  431. }
  432. // Do executes Emulation.setGeolocationOverride against the provided context.
  433. func (p *SetGeolocationOverrideParams) Do(ctx context.Context) (err error) {
  434. return cdp.Execute(ctx, CommandSetGeolocationOverride, p, nil)
  435. }
  436. // GetOverriddenSensorInformationParams [no description].
  437. type GetOverriddenSensorInformationParams struct {
  438. Type SensorType `json:"type"`
  439. }
  440. // GetOverriddenSensorInformation [no description].
  441. //
  442. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-getOverriddenSensorInformation
  443. //
  444. // parameters:
  445. //
  446. // type
  447. func GetOverriddenSensorInformation(typeVal SensorType) *GetOverriddenSensorInformationParams {
  448. return &GetOverriddenSensorInformationParams{
  449. Type: typeVal,
  450. }
  451. }
  452. // GetOverriddenSensorInformationReturns return values.
  453. type GetOverriddenSensorInformationReturns struct {
  454. RequestedSamplingFrequency float64 `json:"requestedSamplingFrequency,omitempty"`
  455. }
  456. // Do executes Emulation.getOverriddenSensorInformation against the provided context.
  457. //
  458. // returns:
  459. //
  460. // requestedSamplingFrequency
  461. func (p *GetOverriddenSensorInformationParams) Do(ctx context.Context) (requestedSamplingFrequency float64, err error) {
  462. // execute
  463. var res GetOverriddenSensorInformationReturns
  464. err = cdp.Execute(ctx, CommandGetOverriddenSensorInformation, p, &res)
  465. if err != nil {
  466. return 0, err
  467. }
  468. return res.RequestedSamplingFrequency, nil
  469. }
  470. // SetSensorOverrideEnabledParams overrides a platform sensor of a given
  471. // type. If |enabled| is true, calls to Sensor.start() will use a virtual sensor
  472. // as backend rather than fetching data from a real hardware sensor. Otherwise,
  473. // existing virtual sensor-backend Sensor objects will fire an error event and
  474. // new calls to Sensor.start() will attempt to use a real sensor instead.
  475. type SetSensorOverrideEnabledParams struct {
  476. Enabled bool `json:"enabled"`
  477. Type SensorType `json:"type"`
  478. Metadata *SensorMetadata `json:"metadata,omitempty"`
  479. }
  480. // SetSensorOverrideEnabled overrides a platform sensor of a given type. If
  481. // |enabled| is true, calls to Sensor.start() will use a virtual sensor as
  482. // backend rather than fetching data from a real hardware sensor. Otherwise,
  483. // existing virtual sensor-backend Sensor objects will fire an error event and
  484. // new calls to Sensor.start() will attempt to use a real sensor instead.
  485. //
  486. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setSensorOverrideEnabled
  487. //
  488. // parameters:
  489. //
  490. // enabled
  491. // type
  492. func SetSensorOverrideEnabled(enabled bool, typeVal SensorType) *SetSensorOverrideEnabledParams {
  493. return &SetSensorOverrideEnabledParams{
  494. Enabled: enabled,
  495. Type: typeVal,
  496. }
  497. }
  498. // WithMetadata [no description].
  499. func (p SetSensorOverrideEnabledParams) WithMetadata(metadata *SensorMetadata) *SetSensorOverrideEnabledParams {
  500. p.Metadata = metadata
  501. return &p
  502. }
  503. // Do executes Emulation.setSensorOverrideEnabled against the provided context.
  504. func (p *SetSensorOverrideEnabledParams) Do(ctx context.Context) (err error) {
  505. return cdp.Execute(ctx, CommandSetSensorOverrideEnabled, p, nil)
  506. }
  507. // SetSensorOverrideReadingsParams updates the sensor readings reported by a
  508. // sensor type previously overridden by setSensorOverrideEnabled.
  509. type SetSensorOverrideReadingsParams struct {
  510. Type SensorType `json:"type"`
  511. Reading *SensorReading `json:"reading"`
  512. }
  513. // SetSensorOverrideReadings updates the sensor readings reported by a sensor
  514. // type previously overridden by setSensorOverrideEnabled.
  515. //
  516. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setSensorOverrideReadings
  517. //
  518. // parameters:
  519. //
  520. // type
  521. // reading
  522. func SetSensorOverrideReadings(typeVal SensorType, reading *SensorReading) *SetSensorOverrideReadingsParams {
  523. return &SetSensorOverrideReadingsParams{
  524. Type: typeVal,
  525. Reading: reading,
  526. }
  527. }
  528. // Do executes Emulation.setSensorOverrideReadings against the provided context.
  529. func (p *SetSensorOverrideReadingsParams) Do(ctx context.Context) (err error) {
  530. return cdp.Execute(ctx, CommandSetSensorOverrideReadings, p, nil)
  531. }
  532. // SetIdleOverrideParams overrides the Idle state.
  533. type SetIdleOverrideParams struct {
  534. IsUserActive bool `json:"isUserActive"` // Mock isUserActive
  535. IsScreenUnlocked bool `json:"isScreenUnlocked"` // Mock isScreenUnlocked
  536. }
  537. // SetIdleOverride overrides the Idle state.
  538. //
  539. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setIdleOverride
  540. //
  541. // parameters:
  542. //
  543. // isUserActive - Mock isUserActive
  544. // isScreenUnlocked - Mock isScreenUnlocked
  545. func SetIdleOverride(isUserActive bool, isScreenUnlocked bool) *SetIdleOverrideParams {
  546. return &SetIdleOverrideParams{
  547. IsUserActive: isUserActive,
  548. IsScreenUnlocked: isScreenUnlocked,
  549. }
  550. }
  551. // Do executes Emulation.setIdleOverride against the provided context.
  552. func (p *SetIdleOverrideParams) Do(ctx context.Context) (err error) {
  553. return cdp.Execute(ctx, CommandSetIdleOverride, p, nil)
  554. }
  555. // ClearIdleOverrideParams clears Idle state overrides.
  556. type ClearIdleOverrideParams struct{}
  557. // ClearIdleOverride clears Idle state overrides.
  558. //
  559. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-clearIdleOverride
  560. func ClearIdleOverride() *ClearIdleOverrideParams {
  561. return &ClearIdleOverrideParams{}
  562. }
  563. // Do executes Emulation.clearIdleOverride against the provided context.
  564. func (p *ClearIdleOverrideParams) Do(ctx context.Context) (err error) {
  565. return cdp.Execute(ctx, CommandClearIdleOverride, nil, nil)
  566. }
  567. // SetPageScaleFactorParams sets a specified page scale factor.
  568. type SetPageScaleFactorParams struct {
  569. PageScaleFactor float64 `json:"pageScaleFactor"` // Page scale factor.
  570. }
  571. // SetPageScaleFactor sets a specified page scale factor.
  572. //
  573. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setPageScaleFactor
  574. //
  575. // parameters:
  576. //
  577. // pageScaleFactor - Page scale factor.
  578. func SetPageScaleFactor(pageScaleFactor float64) *SetPageScaleFactorParams {
  579. return &SetPageScaleFactorParams{
  580. PageScaleFactor: pageScaleFactor,
  581. }
  582. }
  583. // Do executes Emulation.setPageScaleFactor against the provided context.
  584. func (p *SetPageScaleFactorParams) Do(ctx context.Context) (err error) {
  585. return cdp.Execute(ctx, CommandSetPageScaleFactor, p, nil)
  586. }
  587. // SetScriptExecutionDisabledParams switches script execution in the page.
  588. type SetScriptExecutionDisabledParams struct {
  589. Value bool `json:"value"` // Whether script execution should be disabled in the page.
  590. }
  591. // SetScriptExecutionDisabled switches script execution in the page.
  592. //
  593. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setScriptExecutionDisabled
  594. //
  595. // parameters:
  596. //
  597. // value - Whether script execution should be disabled in the page.
  598. func SetScriptExecutionDisabled(value bool) *SetScriptExecutionDisabledParams {
  599. return &SetScriptExecutionDisabledParams{
  600. Value: value,
  601. }
  602. }
  603. // Do executes Emulation.setScriptExecutionDisabled against the provided context.
  604. func (p *SetScriptExecutionDisabledParams) Do(ctx context.Context) (err error) {
  605. return cdp.Execute(ctx, CommandSetScriptExecutionDisabled, p, nil)
  606. }
  607. // SetTouchEmulationEnabledParams enables touch on platforms which do not
  608. // support them.
  609. type SetTouchEmulationEnabledParams struct {
  610. Enabled bool `json:"enabled"` // Whether the touch event emulation should be enabled.
  611. MaxTouchPoints int64 `json:"maxTouchPoints,omitempty"` // Maximum touch points supported. Defaults to one.
  612. }
  613. // SetTouchEmulationEnabled enables touch on platforms which do not support
  614. // them.
  615. //
  616. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setTouchEmulationEnabled
  617. //
  618. // parameters:
  619. //
  620. // enabled - Whether the touch event emulation should be enabled.
  621. func SetTouchEmulationEnabled(enabled bool) *SetTouchEmulationEnabledParams {
  622. return &SetTouchEmulationEnabledParams{
  623. Enabled: enabled,
  624. }
  625. }
  626. // WithMaxTouchPoints maximum touch points supported. Defaults to one.
  627. func (p SetTouchEmulationEnabledParams) WithMaxTouchPoints(maxTouchPoints int64) *SetTouchEmulationEnabledParams {
  628. p.MaxTouchPoints = maxTouchPoints
  629. return &p
  630. }
  631. // Do executes Emulation.setTouchEmulationEnabled against the provided context.
  632. func (p *SetTouchEmulationEnabledParams) Do(ctx context.Context) (err error) {
  633. return cdp.Execute(ctx, CommandSetTouchEmulationEnabled, p, nil)
  634. }
  635. // SetVirtualTimePolicyParams turns on virtual time for all frames (replacing
  636. // real-time with a synthetic time source) and sets the current virtual time
  637. // policy. Note this supersedes any previous time budget.
  638. type SetVirtualTimePolicyParams struct {
  639. Policy VirtualTimePolicy `json:"policy"`
  640. Budget float64 `json:"budget,omitempty"` // If set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent.
  641. MaxVirtualTimeTaskStarvationCount int64 `json:"maxVirtualTimeTaskStarvationCount,omitempty"` // If set this specifies the maximum number of tasks that can be run before virtual is forced forwards to prevent deadlock.
  642. InitialVirtualTime *cdp.TimeSinceEpoch `json:"initialVirtualTime,omitempty"` // If set, base::Time::Now will be overridden to initially return this value.
  643. }
  644. // SetVirtualTimePolicy turns on virtual time for all frames (replacing
  645. // real-time with a synthetic time source) and sets the current virtual time
  646. // policy. Note this supersedes any previous time budget.
  647. //
  648. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setVirtualTimePolicy
  649. //
  650. // parameters:
  651. //
  652. // policy
  653. func SetVirtualTimePolicy(policy VirtualTimePolicy) *SetVirtualTimePolicyParams {
  654. return &SetVirtualTimePolicyParams{
  655. Policy: policy,
  656. }
  657. }
  658. // WithBudget if set, after this many virtual milliseconds have elapsed
  659. // virtual time will be paused and a virtualTimeBudgetExpired event is sent.
  660. func (p SetVirtualTimePolicyParams) WithBudget(budget float64) *SetVirtualTimePolicyParams {
  661. p.Budget = budget
  662. return &p
  663. }
  664. // WithMaxVirtualTimeTaskStarvationCount if set this specifies the maximum
  665. // number of tasks that can be run before virtual is forced forwards to prevent
  666. // deadlock.
  667. func (p SetVirtualTimePolicyParams) WithMaxVirtualTimeTaskStarvationCount(maxVirtualTimeTaskStarvationCount int64) *SetVirtualTimePolicyParams {
  668. p.MaxVirtualTimeTaskStarvationCount = maxVirtualTimeTaskStarvationCount
  669. return &p
  670. }
  671. // WithInitialVirtualTime if set, base::Time::Now will be overridden to
  672. // initially return this value.
  673. func (p SetVirtualTimePolicyParams) WithInitialVirtualTime(initialVirtualTime *cdp.TimeSinceEpoch) *SetVirtualTimePolicyParams {
  674. p.InitialVirtualTime = initialVirtualTime
  675. return &p
  676. }
  677. // SetVirtualTimePolicyReturns return values.
  678. type SetVirtualTimePolicyReturns struct {
  679. VirtualTimeTicksBase float64 `json:"virtualTimeTicksBase,omitempty"` // Absolute timestamp at which virtual time was first enabled (up time in milliseconds).
  680. }
  681. // Do executes Emulation.setVirtualTimePolicy against the provided context.
  682. //
  683. // returns:
  684. //
  685. // virtualTimeTicksBase - Absolute timestamp at which virtual time was first enabled (up time in milliseconds).
  686. func (p *SetVirtualTimePolicyParams) Do(ctx context.Context) (virtualTimeTicksBase float64, err error) {
  687. // execute
  688. var res SetVirtualTimePolicyReturns
  689. err = cdp.Execute(ctx, CommandSetVirtualTimePolicy, p, &res)
  690. if err != nil {
  691. return 0, err
  692. }
  693. return res.VirtualTimeTicksBase, nil
  694. }
  695. // SetLocaleOverrideParams overrides default host system locale with the
  696. // specified one.
  697. type SetLocaleOverrideParams struct {
  698. Locale string `json:"locale,omitempty"` // ICU style C locale (e.g. "en_US"). If not specified or empty, disables the override and restores default host system locale.
  699. }
  700. // SetLocaleOverride overrides default host system locale with the specified
  701. // one.
  702. //
  703. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setLocaleOverride
  704. //
  705. // parameters:
  706. func SetLocaleOverride() *SetLocaleOverrideParams {
  707. return &SetLocaleOverrideParams{}
  708. }
  709. // WithLocale iCU style C locale (e.g. "en_US"). If not specified or empty,
  710. // disables the override and restores default host system locale.
  711. func (p SetLocaleOverrideParams) WithLocale(locale string) *SetLocaleOverrideParams {
  712. p.Locale = locale
  713. return &p
  714. }
  715. // Do executes Emulation.setLocaleOverride against the provided context.
  716. func (p *SetLocaleOverrideParams) Do(ctx context.Context) (err error) {
  717. return cdp.Execute(ctx, CommandSetLocaleOverride, p, nil)
  718. }
  719. // SetTimezoneOverrideParams overrides default host system timezone with the
  720. // specified one.
  721. type SetTimezoneOverrideParams struct {
  722. TimezoneID string `json:"timezoneId"` // The timezone identifier. List of supported timezones: https://source.chromium.org/chromium/chromium/deps/icu.git/+/faee8bc70570192d82d2978a71e2a615788597d1:source/data/misc/metaZones.txt If empty, disables the override and restores default host system timezone.
  723. }
  724. // SetTimezoneOverride overrides default host system timezone with the
  725. // specified one.
  726. //
  727. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setTimezoneOverride
  728. //
  729. // parameters:
  730. //
  731. // timezoneID - The timezone identifier. List of supported timezones: https://source.chromium.org/chromium/chromium/deps/icu.git/+/faee8bc70570192d82d2978a71e2a615788597d1:source/data/misc/metaZones.txt If empty, disables the override and restores default host system timezone.
  732. func SetTimezoneOverride(timezoneID string) *SetTimezoneOverrideParams {
  733. return &SetTimezoneOverrideParams{
  734. TimezoneID: timezoneID,
  735. }
  736. }
  737. // Do executes Emulation.setTimezoneOverride against the provided context.
  738. func (p *SetTimezoneOverrideParams) Do(ctx context.Context) (err error) {
  739. return cdp.Execute(ctx, CommandSetTimezoneOverride, p, nil)
  740. }
  741. // SetDisabledImageTypesParams [no description].
  742. type SetDisabledImageTypesParams struct {
  743. ImageTypes []DisabledImageType `json:"imageTypes"` // Image types to disable.
  744. }
  745. // SetDisabledImageTypes [no description].
  746. //
  747. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDisabledImageTypes
  748. //
  749. // parameters:
  750. //
  751. // imageTypes - Image types to disable.
  752. func SetDisabledImageTypes(imageTypes []DisabledImageType) *SetDisabledImageTypesParams {
  753. return &SetDisabledImageTypesParams{
  754. ImageTypes: imageTypes,
  755. }
  756. }
  757. // Do executes Emulation.setDisabledImageTypes against the provided context.
  758. func (p *SetDisabledImageTypesParams) Do(ctx context.Context) (err error) {
  759. return cdp.Execute(ctx, CommandSetDisabledImageTypes, p, nil)
  760. }
  761. // SetHardwareConcurrencyOverrideParams [no description].
  762. type SetHardwareConcurrencyOverrideParams struct {
  763. HardwareConcurrency int64 `json:"hardwareConcurrency"` // Hardware concurrency to report
  764. }
  765. // SetHardwareConcurrencyOverride [no description].
  766. //
  767. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setHardwareConcurrencyOverride
  768. //
  769. // parameters:
  770. //
  771. // hardwareConcurrency - Hardware concurrency to report
  772. func SetHardwareConcurrencyOverride(hardwareConcurrency int64) *SetHardwareConcurrencyOverrideParams {
  773. return &SetHardwareConcurrencyOverrideParams{
  774. HardwareConcurrency: hardwareConcurrency,
  775. }
  776. }
  777. // Do executes Emulation.setHardwareConcurrencyOverride against the provided context.
  778. func (p *SetHardwareConcurrencyOverrideParams) Do(ctx context.Context) (err error) {
  779. return cdp.Execute(ctx, CommandSetHardwareConcurrencyOverride, p, nil)
  780. }
  781. // SetUserAgentOverrideParams allows overriding user agent with the given
  782. // string. userAgentMetadata must be set for Client Hint headers to be sent.
  783. type SetUserAgentOverrideParams struct {
  784. UserAgent string `json:"userAgent"` // User agent to use.
  785. AcceptLanguage string `json:"acceptLanguage,omitempty"` // Browser language to emulate.
  786. Platform string `json:"platform,omitempty"` // The platform navigator.platform should return.
  787. UserAgentMetadata *UserAgentMetadata `json:"userAgentMetadata,omitempty"` // To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData
  788. }
  789. // SetUserAgentOverride allows overriding user agent with the given string.
  790. // userAgentMetadata must be set for Client Hint headers to be sent.
  791. //
  792. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setUserAgentOverride
  793. //
  794. // parameters:
  795. //
  796. // userAgent - User agent to use.
  797. func SetUserAgentOverride(userAgent string) *SetUserAgentOverrideParams {
  798. return &SetUserAgentOverrideParams{
  799. UserAgent: userAgent,
  800. }
  801. }
  802. // WithAcceptLanguage browser language to emulate.
  803. func (p SetUserAgentOverrideParams) WithAcceptLanguage(acceptLanguage string) *SetUserAgentOverrideParams {
  804. p.AcceptLanguage = acceptLanguage
  805. return &p
  806. }
  807. // WithPlatform the platform navigator.platform should return.
  808. func (p SetUserAgentOverrideParams) WithPlatform(platform string) *SetUserAgentOverrideParams {
  809. p.Platform = platform
  810. return &p
  811. }
  812. // WithUserAgentMetadata to be sent in Sec-CH-UA-* headers and returned in
  813. // navigator.userAgentData.
  814. func (p SetUserAgentOverrideParams) WithUserAgentMetadata(userAgentMetadata *UserAgentMetadata) *SetUserAgentOverrideParams {
  815. p.UserAgentMetadata = userAgentMetadata
  816. return &p
  817. }
  818. // Do executes Emulation.setUserAgentOverride against the provided context.
  819. func (p *SetUserAgentOverrideParams) Do(ctx context.Context) (err error) {
  820. return cdp.Execute(ctx, CommandSetUserAgentOverride, p, nil)
  821. }
  822. // SetAutomationOverrideParams allows overriding the automation flag.
  823. type SetAutomationOverrideParams struct {
  824. Enabled bool `json:"enabled"` // Whether the override should be enabled.
  825. }
  826. // SetAutomationOverride allows overriding the automation flag.
  827. //
  828. // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setAutomationOverride
  829. //
  830. // parameters:
  831. //
  832. // enabled - Whether the override should be enabled.
  833. func SetAutomationOverride(enabled bool) *SetAutomationOverrideParams {
  834. return &SetAutomationOverrideParams{
  835. Enabled: enabled,
  836. }
  837. }
  838. // Do executes Emulation.setAutomationOverride against the provided context.
  839. func (p *SetAutomationOverrideParams) Do(ctx context.Context) (err error) {
  840. return cdp.Execute(ctx, CommandSetAutomationOverride, p, nil)
  841. }
  842. // Command names.
  843. const (
  844. CommandClearDeviceMetricsOverride = "Emulation.clearDeviceMetricsOverride"
  845. CommandClearGeolocationOverride = "Emulation.clearGeolocationOverride"
  846. CommandResetPageScaleFactor = "Emulation.resetPageScaleFactor"
  847. CommandSetFocusEmulationEnabled = "Emulation.setFocusEmulationEnabled"
  848. CommandSetAutoDarkModeOverride = "Emulation.setAutoDarkModeOverride"
  849. CommandSetCPUThrottlingRate = "Emulation.setCPUThrottlingRate"
  850. CommandSetDefaultBackgroundColorOverride = "Emulation.setDefaultBackgroundColorOverride"
  851. CommandSetDeviceMetricsOverride = "Emulation.setDeviceMetricsOverride"
  852. CommandSetDevicePostureOverride = "Emulation.setDevicePostureOverride"
  853. CommandClearDevicePostureOverride = "Emulation.clearDevicePostureOverride"
  854. CommandSetScrollbarsHidden = "Emulation.setScrollbarsHidden"
  855. CommandSetDocumentCookieDisabled = "Emulation.setDocumentCookieDisabled"
  856. CommandSetEmitTouchEventsForMouse = "Emulation.setEmitTouchEventsForMouse"
  857. CommandSetEmulatedMedia = "Emulation.setEmulatedMedia"
  858. CommandSetEmulatedVisionDeficiency = "Emulation.setEmulatedVisionDeficiency"
  859. CommandSetGeolocationOverride = "Emulation.setGeolocationOverride"
  860. CommandGetOverriddenSensorInformation = "Emulation.getOverriddenSensorInformation"
  861. CommandSetSensorOverrideEnabled = "Emulation.setSensorOverrideEnabled"
  862. CommandSetSensorOverrideReadings = "Emulation.setSensorOverrideReadings"
  863. CommandSetIdleOverride = "Emulation.setIdleOverride"
  864. CommandClearIdleOverride = "Emulation.clearIdleOverride"
  865. CommandSetPageScaleFactor = "Emulation.setPageScaleFactor"
  866. CommandSetScriptExecutionDisabled = "Emulation.setScriptExecutionDisabled"
  867. CommandSetTouchEmulationEnabled = "Emulation.setTouchEmulationEnabled"
  868. CommandSetVirtualTimePolicy = "Emulation.setVirtualTimePolicy"
  869. CommandSetLocaleOverride = "Emulation.setLocaleOverride"
  870. CommandSetTimezoneOverride = "Emulation.setTimezoneOverride"
  871. CommandSetDisabledImageTypes = "Emulation.setDisabledImageTypes"
  872. CommandSetHardwareConcurrencyOverride = "Emulation.setHardwareConcurrencyOverride"
  873. CommandSetUserAgentOverride = "Emulation.setUserAgentOverride"
  874. CommandSetAutomationOverride = "Emulation.setAutomationOverride"
  875. )