1// Copyright (c) 2020 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5/** 6 * This file is auto-generated, do not edit manually. * 7 * Re-generate with: npm run generate-protocol-resources. 8 */ 9 10 11/** 12 * API generated from Protocol commands and events. 13 */ 14declare namespace ProtocolProxyApi { 15 declare interface ProtocolApi { 16 Accessibility: AccessibilityApi; 17 18 Animation: AnimationApi; 19 20 ApplicationCache: ApplicationCacheApi; 21 22 Audits: AuditsApi; 23 24 BackgroundService: BackgroundServiceApi; 25 26 Browser: BrowserApi; 27 28 CSS: CSSApi; 29 30 CacheStorage: CacheStorageApi; 31 32 Cast: CastApi; 33 34 DOM: DOMApi; 35 36 DOMDebugger: DOMDebuggerApi; 37 38 DOMSnapshot: DOMSnapshotApi; 39 40 DOMStorage: DOMStorageApi; 41 42 Database: DatabaseApi; 43 44 DeviceOrientation: DeviceOrientationApi; 45 46 Emulation: EmulationApi; 47 48 HeadlessExperimental: HeadlessExperimentalApi; 49 50 IO: IOApi; 51 52 IndexedDB: IndexedDBApi; 53 54 Input: InputApi; 55 56 Inspector: InspectorApi; 57 58 LayerTree: LayerTreeApi; 59 60 Log: LogApi; 61 62 Memory: MemoryApi; 63 64 Network: NetworkApi; 65 66 Overlay: OverlayApi; 67 68 Page: PageApi; 69 70 Performance: PerformanceApi; 71 72 Security: SecurityApi; 73 74 ServiceWorker: ServiceWorkerApi; 75 76 Storage: StorageApi; 77 78 SystemInfo: SystemInfoApi; 79 80 Target: TargetApi; 81 82 Tethering: TetheringApi; 83 84 Tracing: TracingApi; 85 86 Fetch: FetchApi; 87 88 WebAudio: WebAudioApi; 89 90 WebAuthn: WebAuthnApi; 91 92 Media: MediaApi; 93 94 Console: ConsoleApi; 95 96 Debugger: DebuggerApi; 97 98 HeapProfiler: HeapProfilerApi; 99 100 Profiler: ProfilerApi; 101 102 Runtime: RuntimeApi; 103 104 Schema: SchemaApi; 105 } 106 107 108 export interface AccessibilityApi { 109 /** 110 * Disables the accessibility domain. 111 */ 112 disable(): Promise<void>; 113 114 /** 115 * Enables the accessibility domain which causes `AXNodeId`s to remain consistent between method calls. 116 * This turns on accessibility for the page, which can impact performance until accessibility is disabled. 117 */ 118 enable(): Promise<void>; 119 120 /** 121 * Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists. 122 */ 123 getPartialAXTree(params: Protocol.Accessibility.GetPartialAXTreeRequest): 124 Promise<Protocol.Accessibility.GetPartialAXTreeResponse>; 125 126 /** 127 * Fetches the entire accessibility tree 128 */ 129 getFullAXTree(): Promise<Protocol.Accessibility.GetFullAXTreeResponse>; 130 } 131 132 export interface AnimationApi { 133 /** 134 * Disables animation domain notifications. 135 */ 136 disable(): Promise<void>; 137 138 /** 139 * Enables animation domain notifications. 140 */ 141 enable(): Promise<void>; 142 143 /** 144 * Returns the current time of the an animation. 145 */ 146 getCurrentTime(params: Protocol.Animation.GetCurrentTimeRequest): 147 Promise<Protocol.Animation.GetCurrentTimeResponse>; 148 149 /** 150 * Gets the playback rate of the document timeline. 151 */ 152 getPlaybackRate(): Promise<Protocol.Animation.GetPlaybackRateResponse>; 153 154 /** 155 * Releases a set of animations to no longer be manipulated. 156 */ 157 releaseAnimations(params: Protocol.Animation.ReleaseAnimationsRequest): Promise<void>; 158 159 /** 160 * Gets the remote object of the Animation. 161 */ 162 resolveAnimation(params: Protocol.Animation.ResolveAnimationRequest): 163 Promise<Protocol.Animation.ResolveAnimationResponse>; 164 165 /** 166 * Seek a set of animations to a particular time within each animation. 167 */ 168 seekAnimations(params: Protocol.Animation.SeekAnimationsRequest): Promise<void>; 169 170 /** 171 * Sets the paused state of a set of animations. 172 */ 173 setPaused(params: Protocol.Animation.SetPausedRequest): Promise<void>; 174 175 /** 176 * Sets the playback rate of the document timeline. 177 */ 178 setPlaybackRate(params: Protocol.Animation.SetPlaybackRateRequest): Promise<void>; 179 180 /** 181 * Sets the timing of an animation node. 182 */ 183 setTiming(params: Protocol.Animation.SetTimingRequest): Promise<void>; 184 185 /** 186 * Event for when an animation has been cancelled. 187 */ 188 on(event: 'animationCanceled', listener: (params: Protocol.Animation.AnimationCanceledEvent) => void): void; 189 190 /** 191 * Event for each animation that has been created. 192 */ 193 on(event: 'animationCreated', listener: (params: Protocol.Animation.AnimationCreatedEvent) => void): void; 194 195 /** 196 * Event for animation that has been started. 197 */ 198 on(event: 'animationStarted', listener: (params: Protocol.Animation.AnimationStartedEvent) => void): void; 199 } 200 201 export interface ApplicationCacheApi { 202 /** 203 * Enables application cache domain notifications. 204 */ 205 enable(): Promise<void>; 206 207 /** 208 * Returns relevant application cache data for the document in given frame. 209 */ 210 getApplicationCacheForFrame(params: Protocol.ApplicationCache.GetApplicationCacheForFrameRequest): 211 Promise<Protocol.ApplicationCache.GetApplicationCacheForFrameResponse>; 212 213 /** 214 * Returns array of frame identifiers with manifest urls for each frame containing a document 215 * associated with some application cache. 216 */ 217 getFramesWithManifests(): Promise<Protocol.ApplicationCache.GetFramesWithManifestsResponse>; 218 219 /** 220 * Returns manifest URL for document in the given frame. 221 */ 222 getManifestForFrame(params: Protocol.ApplicationCache.GetManifestForFrameRequest): 223 Promise<Protocol.ApplicationCache.GetManifestForFrameResponse>; 224 225 on(event: 'applicationCacheStatusUpdated', 226 listener: (params: Protocol.ApplicationCache.ApplicationCacheStatusUpdatedEvent) => void): void; 227 228 on(event: 'networkStateUpdated', 229 listener: (params: Protocol.ApplicationCache.NetworkStateUpdatedEvent) => void): void; 230 } 231 232 export interface AuditsApi { 233 /** 234 * Returns the response body and size if it were re-encoded with the specified settings. Only 235 * applies to images. 236 */ 237 getEncodedResponse(params: Protocol.Audits.GetEncodedResponseRequest): 238 Promise<Protocol.Audits.GetEncodedResponseResponse>; 239 240 /** 241 * Disables issues domain, prevents further issues from being reported to the client. 242 */ 243 disable(): Promise<void>; 244 245 /** 246 * Enables issues domain, sends the issues collected so far to the client by means of the 247 * `issueAdded` event. 248 */ 249 enable(): Promise<void>; 250 251 on(event: 'issueAdded', listener: (params: Protocol.Audits.IssueAddedEvent) => void): void; 252 } 253 254 export interface BackgroundServiceApi { 255 /** 256 * Enables event updates for the service. 257 */ 258 startObserving(params: Protocol.BackgroundService.StartObservingRequest): Promise<void>; 259 260 /** 261 * Disables event updates for the service. 262 */ 263 stopObserving(params: Protocol.BackgroundService.StopObservingRequest): Promise<void>; 264 265 /** 266 * Set the recording state for the service. 267 */ 268 setRecording(params: Protocol.BackgroundService.SetRecordingRequest): Promise<void>; 269 270 /** 271 * Clears all stored data for the service. 272 */ 273 clearEvents(params: Protocol.BackgroundService.ClearEventsRequest): Promise<void>; 274 275 /** 276 * Called when the recording state for the service has been updated. 277 */ 278 on(event: 'recordingStateChanged', 279 listener: (params: Protocol.BackgroundService.RecordingStateChangedEvent) => void): void; 280 281 /** 282 * Called with all existing backgroundServiceEvents when enabled, and all new 283 * events afterwards if enabled and recording. 284 */ 285 on(event: 'backgroundServiceEventReceived', 286 listener: (params: Protocol.BackgroundService.BackgroundServiceEventReceivedEvent) => void): void; 287 } 288 289 export interface BrowserApi { 290 /** 291 * Set permission settings for given origin. 292 */ 293 setPermission(params: Protocol.Browser.SetPermissionRequest): Promise<void>; 294 295 /** 296 * Grant specific permissions to the given origin and reject all others. 297 */ 298 grantPermissions(params: Protocol.Browser.GrantPermissionsRequest): Promise<void>; 299 300 /** 301 * Reset all permission management for all origins. 302 */ 303 resetPermissions(params: Protocol.Browser.ResetPermissionsRequest): Promise<void>; 304 305 /** 306 * Close browser gracefully. 307 */ 308 close(): Promise<void>; 309 310 /** 311 * Crashes browser on the main thread. 312 */ 313 crash(): Promise<void>; 314 315 /** 316 * Crashes GPU process. 317 */ 318 crashGpuProcess(): Promise<void>; 319 320 /** 321 * Returns version information. 322 */ 323 getVersion(): Promise<Protocol.Browser.GetVersionResponse>; 324 325 /** 326 * Returns the command line switches for the browser process if, and only if 327 * --enable-automation is on the commandline. 328 */ 329 getBrowserCommandLine(): Promise<Protocol.Browser.GetBrowserCommandLineResponse>; 330 331 /** 332 * Get Chrome histograms. 333 */ 334 getHistograms(params: Protocol.Browser.GetHistogramsRequest): Promise<Protocol.Browser.GetHistogramsResponse>; 335 336 /** 337 * Get a Chrome histogram by name. 338 */ 339 getHistogram(params: Protocol.Browser.GetHistogramRequest): Promise<Protocol.Browser.GetHistogramResponse>; 340 341 /** 342 * Get position and size of the browser window. 343 */ 344 getWindowBounds(params: Protocol.Browser.GetWindowBoundsRequest): Promise<Protocol.Browser.GetWindowBoundsResponse>; 345 346 /** 347 * Get the browser window that contains the devtools target. 348 */ 349 getWindowForTarget(params: Protocol.Browser.GetWindowForTargetRequest): 350 Promise<Protocol.Browser.GetWindowForTargetResponse>; 351 352 /** 353 * Set position and/or size of the browser window. 354 */ 355 setWindowBounds(params: Protocol.Browser.SetWindowBoundsRequest): Promise<void>; 356 357 /** 358 * Set dock tile details, platform-specific. 359 */ 360 setDockTile(params: Protocol.Browser.SetDockTileRequest): Promise<void>; 361 } 362 363 export interface CSSApi { 364 /** 365 * Inserts a new rule with the given `ruleText` in a stylesheet with given `styleSheetId`, at the 366 * position specified by `location`. 367 */ 368 addRule(params: Protocol.CSS.AddRuleRequest): Promise<Protocol.CSS.AddRuleResponse>; 369 370 /** 371 * Returns all class names from specified stylesheet. 372 */ 373 collectClassNames(params: Protocol.CSS.CollectClassNamesRequest): Promise<Protocol.CSS.CollectClassNamesResponse>; 374 375 /** 376 * Creates a new special "via-inspector" stylesheet in the frame with given `frameId`. 377 */ 378 createStyleSheet(params: Protocol.CSS.CreateStyleSheetRequest): Promise<Protocol.CSS.CreateStyleSheetResponse>; 379 380 /** 381 * Disables the CSS agent for the given page. 382 */ 383 disable(): Promise<void>; 384 385 /** 386 * Enables the CSS agent for the given page. Clients should not assume that the CSS agent has been 387 * enabled until the result of this command is received. 388 */ 389 enable(): Promise<void>; 390 391 /** 392 * Ensures that the given node will have specified pseudo-classes whenever its style is computed by 393 * the browser. 394 */ 395 forcePseudoState(params: Protocol.CSS.ForcePseudoStateRequest): Promise<void>; 396 397 getBackgroundColors(params: Protocol.CSS.GetBackgroundColorsRequest): 398 Promise<Protocol.CSS.GetBackgroundColorsResponse>; 399 400 /** 401 * Returns the computed style for a DOM node identified by `nodeId`. 402 */ 403 getComputedStyleForNode(params: Protocol.CSS.GetComputedStyleForNodeRequest): 404 Promise<Protocol.CSS.GetComputedStyleForNodeResponse>; 405 406 /** 407 * Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM 408 * attributes) for a DOM node identified by `nodeId`. 409 */ 410 getInlineStylesForNode(params: Protocol.CSS.GetInlineStylesForNodeRequest): 411 Promise<Protocol.CSS.GetInlineStylesForNodeResponse>; 412 413 /** 414 * Returns requested styles for a DOM node identified by `nodeId`. 415 */ 416 getMatchedStylesForNode(params: Protocol.CSS.GetMatchedStylesForNodeRequest): 417 Promise<Protocol.CSS.GetMatchedStylesForNodeResponse>; 418 419 /** 420 * Returns all media queries parsed by the rendering engine. 421 */ 422 getMediaQueries(): Promise<Protocol.CSS.GetMediaQueriesResponse>; 423 424 /** 425 * Requests information about platform fonts which we used to render child TextNodes in the given 426 * node. 427 */ 428 getPlatformFontsForNode(params: Protocol.CSS.GetPlatformFontsForNodeRequest): 429 Promise<Protocol.CSS.GetPlatformFontsForNodeResponse>; 430 431 /** 432 * Returns the current textual content for a stylesheet. 433 */ 434 getStyleSheetText(params: Protocol.CSS.GetStyleSheetTextRequest): Promise<Protocol.CSS.GetStyleSheetTextResponse>; 435 436 /** 437 * Find a rule with the given active property for the given node and set the new value for this 438 * property 439 */ 440 setEffectivePropertyValueForNode(params: Protocol.CSS.SetEffectivePropertyValueForNodeRequest): Promise<void>; 441 442 /** 443 * Modifies the keyframe rule key text. 444 */ 445 setKeyframeKey(params: Protocol.CSS.SetKeyframeKeyRequest): Promise<Protocol.CSS.SetKeyframeKeyResponse>; 446 447 /** 448 * Modifies the rule selector. 449 */ 450 setMediaText(params: Protocol.CSS.SetMediaTextRequest): Promise<Protocol.CSS.SetMediaTextResponse>; 451 452 /** 453 * Modifies the rule selector. 454 */ 455 setRuleSelector(params: Protocol.CSS.SetRuleSelectorRequest): Promise<Protocol.CSS.SetRuleSelectorResponse>; 456 457 /** 458 * Sets the new stylesheet text. 459 */ 460 setStyleSheetText(params: Protocol.CSS.SetStyleSheetTextRequest): Promise<Protocol.CSS.SetStyleSheetTextResponse>; 461 462 /** 463 * Applies specified style edits one after another in the given order. 464 */ 465 setStyleTexts(params: Protocol.CSS.SetStyleTextsRequest): Promise<Protocol.CSS.SetStyleTextsResponse>; 466 467 /** 468 * Enables the selector recording. 469 */ 470 startRuleUsageTracking(): Promise<void>; 471 472 /** 473 * Stop tracking rule usage and return the list of rules that were used since last call to 474 * `takeCoverageDelta` (or since start of coverage instrumentation) 475 */ 476 stopRuleUsageTracking(): Promise<Protocol.CSS.StopRuleUsageTrackingResponse>; 477 478 /** 479 * Obtain list of rules that became used since last call to this method (or since start of coverage 480 * instrumentation) 481 */ 482 takeCoverageDelta(): Promise<Protocol.CSS.TakeCoverageDeltaResponse>; 483 484 /** 485 * Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded 486 * web font 487 */ 488 on(event: 'fontsUpdated', listener: (params: Protocol.CSS.FontsUpdatedEvent) => void): void; 489 490 /** 491 * Fires whenever a MediaQuery result changes (for example, after a browser window has been 492 * resized.) The current implementation considers only viewport-dependent media features. 493 */ 494 on(event: 'mediaQueryResultChanged', listener: () => void): void; 495 496 /** 497 * Fired whenever an active document stylesheet is added. 498 */ 499 on(event: 'styleSheetAdded', listener: (params: Protocol.CSS.StyleSheetAddedEvent) => void): void; 500 501 /** 502 * Fired whenever a stylesheet is changed as a result of the client operation. 503 */ 504 on(event: 'styleSheetChanged', listener: (params: Protocol.CSS.StyleSheetChangedEvent) => void): void; 505 506 /** 507 * Fired whenever an active document stylesheet is removed. 508 */ 509 on(event: 'styleSheetRemoved', listener: (params: Protocol.CSS.StyleSheetRemovedEvent) => void): void; 510 } 511 512 export interface CacheStorageApi { 513 /** 514 * Deletes a cache. 515 */ 516 deleteCache(params: Protocol.CacheStorage.DeleteCacheRequest): Promise<void>; 517 518 /** 519 * Deletes a cache entry. 520 */ 521 deleteEntry(params: Protocol.CacheStorage.DeleteEntryRequest): Promise<void>; 522 523 /** 524 * Requests cache names. 525 */ 526 requestCacheNames(params: Protocol.CacheStorage.RequestCacheNamesRequest): 527 Promise<Protocol.CacheStorage.RequestCacheNamesResponse>; 528 529 /** 530 * Fetches cache entry. 531 */ 532 requestCachedResponse(params: Protocol.CacheStorage.RequestCachedResponseRequest): 533 Promise<Protocol.CacheStorage.RequestCachedResponseResponse>; 534 535 /** 536 * Requests data from cache. 537 */ 538 requestEntries(params: Protocol.CacheStorage.RequestEntriesRequest): 539 Promise<Protocol.CacheStorage.RequestEntriesResponse>; 540 } 541 542 export interface CastApi { 543 /** 544 * Starts observing for sinks that can be used for tab mirroring, and if set, 545 * sinks compatible with |presentationUrl| as well. When sinks are found, a 546 * |sinksUpdated| event is fired. 547 * Also starts observing for issue messages. When an issue is added or removed, 548 * an |issueUpdated| event is fired. 549 */ 550 enable(params: Protocol.Cast.EnableRequest): Promise<void>; 551 552 /** 553 * Stops observing for sinks and issues. 554 */ 555 disable(): Promise<void>; 556 557 /** 558 * Sets a sink to be used when the web page requests the browser to choose a 559 * sink via Presentation API, Remote Playback API, or Cast SDK. 560 */ 561 setSinkToUse(params: Protocol.Cast.SetSinkToUseRequest): Promise<void>; 562 563 /** 564 * Starts mirroring the tab to the sink. 565 */ 566 startTabMirroring(params: Protocol.Cast.StartTabMirroringRequest): Promise<void>; 567 568 /** 569 * Stops the active Cast session on the sink. 570 */ 571 stopCasting(params: Protocol.Cast.StopCastingRequest): Promise<void>; 572 573 /** 574 * This is fired whenever the list of available sinks changes. A sink is a 575 * device or a software surface that you can cast to. 576 */ 577 on(event: 'sinksUpdated', listener: (params: Protocol.Cast.SinksUpdatedEvent) => void): void; 578 579 /** 580 * This is fired whenever the outstanding issue/error message changes. 581 * |issueMessage| is empty if there is no issue. 582 */ 583 on(event: 'issueUpdated', listener: (params: Protocol.Cast.IssueUpdatedEvent) => void): void; 584 } 585 586 export interface DOMApi { 587 /** 588 * Collects class names for the node with given id and all of it's child nodes. 589 */ 590 collectClassNamesFromSubtree(params: Protocol.DOM.CollectClassNamesFromSubtreeRequest): 591 Promise<Protocol.DOM.CollectClassNamesFromSubtreeResponse>; 592 593 /** 594 * Creates a deep copy of the specified node and places it into the target container before the 595 * given anchor. 596 */ 597 copyTo(params: Protocol.DOM.CopyToRequest): Promise<Protocol.DOM.CopyToResponse>; 598 599 /** 600 * Describes node given its id, does not require domain to be enabled. Does not start tracking any 601 * objects, can be used for automation. 602 */ 603 describeNode(params: Protocol.DOM.DescribeNodeRequest): Promise<Protocol.DOM.DescribeNodeResponse>; 604 605 /** 606 * Scrolls the specified rect of the given node into view if not already visible. 607 * Note: exactly one between nodeId, backendNodeId and objectId should be passed 608 * to identify the node. 609 */ 610 scrollIntoViewIfNeeded(params: Protocol.DOM.ScrollIntoViewIfNeededRequest): Promise<void>; 611 612 /** 613 * Disables DOM agent for the given page. 614 */ 615 disable(): Promise<void>; 616 617 /** 618 * Discards search results from the session with the given id. `getSearchResults` should no longer 619 * be called for that search. 620 */ 621 discardSearchResults(params: Protocol.DOM.DiscardSearchResultsRequest): Promise<void>; 622 623 /** 624 * Enables DOM agent for the given page. 625 */ 626 enable(): Promise<void>; 627 628 /** 629 * Focuses the given element. 630 */ 631 focus(params: Protocol.DOM.FocusRequest): Promise<void>; 632 633 /** 634 * Returns attributes for the specified node. 635 */ 636 getAttributes(params: Protocol.DOM.GetAttributesRequest): Promise<Protocol.DOM.GetAttributesResponse>; 637 638 /** 639 * Returns boxes for the given node. 640 */ 641 getBoxModel(params: Protocol.DOM.GetBoxModelRequest): Promise<Protocol.DOM.GetBoxModelResponse>; 642 643 /** 644 * Returns quads that describe node position on the page. This method 645 * might return multiple quads for inline nodes. 646 */ 647 getContentQuads(params: Protocol.DOM.GetContentQuadsRequest): Promise<Protocol.DOM.GetContentQuadsResponse>; 648 649 /** 650 * Returns the root DOM node (and optionally the subtree) to the caller. 651 */ 652 getDocument(params: Protocol.DOM.GetDocumentRequest): Promise<Protocol.DOM.GetDocumentResponse>; 653 654 /** 655 * Returns the root DOM node (and optionally the subtree) to the caller. 656 */ 657 getFlattenedDocument(params: Protocol.DOM.GetFlattenedDocumentRequest): 658 Promise<Protocol.DOM.GetFlattenedDocumentResponse>; 659 660 /** 661 * Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is 662 * either returned or not. 663 */ 664 getNodeForLocation(params: Protocol.DOM.GetNodeForLocationRequest): 665 Promise<Protocol.DOM.GetNodeForLocationResponse>; 666 667 /** 668 * Returns node's HTML markup. 669 */ 670 getOuterHTML(params: Protocol.DOM.GetOuterHTMLRequest): Promise<Protocol.DOM.GetOuterHTMLResponse>; 671 672 /** 673 * Returns the id of the nearest ancestor that is a relayout boundary. 674 */ 675 getRelayoutBoundary(params: Protocol.DOM.GetRelayoutBoundaryRequest): 676 Promise<Protocol.DOM.GetRelayoutBoundaryResponse>; 677 678 /** 679 * Returns search results from given `fromIndex` to given `toIndex` from the search with the given 680 * identifier. 681 */ 682 getSearchResults(params: Protocol.DOM.GetSearchResultsRequest): Promise<Protocol.DOM.GetSearchResultsResponse>; 683 684 /** 685 * Hides any highlight. 686 */ 687 hideHighlight(): Promise<void>; 688 689 /** 690 * Highlights DOM node. 691 */ 692 highlightNode(): Promise<void>; 693 694 /** 695 * Highlights given rectangle. 696 */ 697 highlightRect(): Promise<void>; 698 699 /** 700 * Marks last undoable state. 701 */ 702 markUndoableState(): Promise<void>; 703 704 /** 705 * Moves node into the new container, places it before the given anchor. 706 */ 707 moveTo(params: Protocol.DOM.MoveToRequest): Promise<Protocol.DOM.MoveToResponse>; 708 709 /** 710 * Searches for a given string in the DOM tree. Use `getSearchResults` to access search results or 711 * `cancelSearch` to end this search session. 712 */ 713 performSearch(params: Protocol.DOM.PerformSearchRequest): Promise<Protocol.DOM.PerformSearchResponse>; 714 715 /** 716 * Requests that the node is sent to the caller given its path. // FIXME, use XPath 717 */ 718 pushNodeByPathToFrontend(params: Protocol.DOM.PushNodeByPathToFrontendRequest): 719 Promise<Protocol.DOM.PushNodeByPathToFrontendResponse>; 720 721 /** 722 * Requests that a batch of nodes is sent to the caller given their backend node ids. 723 */ 724 pushNodesByBackendIdsToFrontend(params: Protocol.DOM.PushNodesByBackendIdsToFrontendRequest): 725 Promise<Protocol.DOM.PushNodesByBackendIdsToFrontendResponse>; 726 727 /** 728 * Executes `querySelector` on a given node. 729 */ 730 querySelector(params: Protocol.DOM.QuerySelectorRequest): Promise<Protocol.DOM.QuerySelectorResponse>; 731 732 /** 733 * Executes `querySelectorAll` on a given node. 734 */ 735 querySelectorAll(params: Protocol.DOM.QuerySelectorAllRequest): Promise<Protocol.DOM.QuerySelectorAllResponse>; 736 737 /** 738 * Re-does the last undone action. 739 */ 740 redo(): Promise<void>; 741 742 /** 743 * Removes attribute with given name from an element with given id. 744 */ 745 removeAttribute(params: Protocol.DOM.RemoveAttributeRequest): Promise<void>; 746 747 /** 748 * Removes node with given id. 749 */ 750 removeNode(params: Protocol.DOM.RemoveNodeRequest): Promise<void>; 751 752 /** 753 * Requests that children of the node with given id are returned to the caller in form of 754 * `setChildNodes` events where not only immediate children are retrieved, but all children down to 755 * the specified depth. 756 */ 757 requestChildNodes(params: Protocol.DOM.RequestChildNodesRequest): Promise<void>; 758 759 /** 760 * Requests that the node is sent to the caller given the JavaScript node object reference. All 761 * nodes that form the path from the node to the root are also sent to the client as a series of 762 * `setChildNodes` notifications. 763 */ 764 requestNode(params: Protocol.DOM.RequestNodeRequest): Promise<Protocol.DOM.RequestNodeResponse>; 765 766 /** 767 * Resolves the JavaScript node object for a given NodeId or BackendNodeId. 768 */ 769 resolveNode(params: Protocol.DOM.ResolveNodeRequest): Promise<Protocol.DOM.ResolveNodeResponse>; 770 771 /** 772 * Sets attribute for an element with given id. 773 */ 774 setAttributeValue(params: Protocol.DOM.SetAttributeValueRequest): Promise<void>; 775 776 /** 777 * Sets attributes on element with given id. This method is useful when user edits some existing 778 * attribute value and types in several attribute name/value pairs. 779 */ 780 setAttributesAsText(params: Protocol.DOM.SetAttributesAsTextRequest): Promise<void>; 781 782 /** 783 * Sets files for the given file input element. 784 */ 785 setFileInputFiles(params: Protocol.DOM.SetFileInputFilesRequest): Promise<void>; 786 787 /** 788 * Sets if stack traces should be captured for Nodes. See `Node.getNodeStackTraces`. Default is disabled. 789 */ 790 setNodeStackTracesEnabled(params: Protocol.DOM.SetNodeStackTracesEnabledRequest): Promise<void>; 791 792 /** 793 * Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation. 794 */ 795 getNodeStackTraces(params: Protocol.DOM.GetNodeStackTracesRequest): 796 Promise<Protocol.DOM.GetNodeStackTracesResponse>; 797 798 /** 799 * Returns file information for the given 800 * File wrapper. 801 */ 802 getFileInfo(params: Protocol.DOM.GetFileInfoRequest): Promise<Protocol.DOM.GetFileInfoResponse>; 803 804 /** 805 * Enables console to refer to the node with given id via $x (see Command Line API for more details 806 * $x functions). 807 */ 808 setInspectedNode(params: Protocol.DOM.SetInspectedNodeRequest): Promise<void>; 809 810 /** 811 * Sets node name for a node with given id. 812 */ 813 setNodeName(params: Protocol.DOM.SetNodeNameRequest): Promise<Protocol.DOM.SetNodeNameResponse>; 814 815 /** 816 * Sets node value for a node with given id. 817 */ 818 setNodeValue(params: Protocol.DOM.SetNodeValueRequest): Promise<void>; 819 820 /** 821 * Sets node HTML markup, returns new node id. 822 */ 823 setOuterHTML(params: Protocol.DOM.SetOuterHTMLRequest): Promise<void>; 824 825 /** 826 * Undoes the last performed action. 827 */ 828 undo(): Promise<void>; 829 830 /** 831 * Returns iframe node that owns iframe with the given domain. 832 */ 833 getFrameOwner(params: Protocol.DOM.GetFrameOwnerRequest): Promise<Protocol.DOM.GetFrameOwnerResponse>; 834 835 /** 836 * Fired when `Element`'s attribute is modified. 837 */ 838 on(event: 'attributeModified', listener: (params: Protocol.DOM.AttributeModifiedEvent) => void): void; 839 840 /** 841 * Fired when `Element`'s attribute is removed. 842 */ 843 on(event: 'attributeRemoved', listener: (params: Protocol.DOM.AttributeRemovedEvent) => void): void; 844 845 /** 846 * Mirrors `DOMCharacterDataModified` event. 847 */ 848 on(event: 'characterDataModified', listener: (params: Protocol.DOM.CharacterDataModifiedEvent) => void): void; 849 850 /** 851 * Fired when `Container`'s child node count has changed. 852 */ 853 on(event: 'childNodeCountUpdated', listener: (params: Protocol.DOM.ChildNodeCountUpdatedEvent) => void): void; 854 855 /** 856 * Mirrors `DOMNodeInserted` event. 857 */ 858 on(event: 'childNodeInserted', listener: (params: Protocol.DOM.ChildNodeInsertedEvent) => void): void; 859 860 /** 861 * Mirrors `DOMNodeRemoved` event. 862 */ 863 on(event: 'childNodeRemoved', listener: (params: Protocol.DOM.ChildNodeRemovedEvent) => void): void; 864 865 /** 866 * Called when distrubution is changed. 867 */ 868 on(event: 'distributedNodesUpdated', listener: (params: Protocol.DOM.DistributedNodesUpdatedEvent) => void): void; 869 870 /** 871 * Fired when `Document` has been totally updated. Node ids are no longer valid. 872 */ 873 on(event: 'documentUpdated', listener: () => void): void; 874 875 /** 876 * Fired when `Element`'s inline style is modified via a CSS property modification. 877 */ 878 on(event: 'inlineStyleInvalidated', listener: (params: Protocol.DOM.InlineStyleInvalidatedEvent) => void): void; 879 880 /** 881 * Called when a pseudo element is added to an element. 882 */ 883 on(event: 'pseudoElementAdded', listener: (params: Protocol.DOM.PseudoElementAddedEvent) => void): void; 884 885 /** 886 * Called when a pseudo element is removed from an element. 887 */ 888 on(event: 'pseudoElementRemoved', listener: (params: Protocol.DOM.PseudoElementRemovedEvent) => void): void; 889 890 /** 891 * Fired when backend wants to provide client with the missing DOM structure. This happens upon 892 * most of the calls requesting node ids. 893 */ 894 on(event: 'setChildNodes', listener: (params: Protocol.DOM.SetChildNodesEvent) => void): void; 895 896 /** 897 * Called when shadow root is popped from the element. 898 */ 899 on(event: 'shadowRootPopped', listener: (params: Protocol.DOM.ShadowRootPoppedEvent) => void): void; 900 901 /** 902 * Called when shadow root is pushed into the element. 903 */ 904 on(event: 'shadowRootPushed', listener: (params: Protocol.DOM.ShadowRootPushedEvent) => void): void; 905 } 906 907 export interface DOMDebuggerApi { 908 /** 909 * Returns event listeners of the given object. 910 */ 911 getEventListeners(params: Protocol.DOMDebugger.GetEventListenersRequest): 912 Promise<Protocol.DOMDebugger.GetEventListenersResponse>; 913 914 /** 915 * Removes DOM breakpoint that was set using `setDOMBreakpoint`. 916 */ 917 removeDOMBreakpoint(params: Protocol.DOMDebugger.RemoveDOMBreakpointRequest): Promise<void>; 918 919 /** 920 * Removes breakpoint on particular DOM event. 921 */ 922 removeEventListenerBreakpoint(params: Protocol.DOMDebugger.RemoveEventListenerBreakpointRequest): Promise<void>; 923 924 /** 925 * Removes breakpoint on particular native event. 926 */ 927 removeInstrumentationBreakpoint(params: Protocol.DOMDebugger.RemoveInstrumentationBreakpointRequest): Promise<void>; 928 929 /** 930 * Removes breakpoint from XMLHttpRequest. 931 */ 932 removeXHRBreakpoint(params: Protocol.DOMDebugger.RemoveXHRBreakpointRequest): Promise<void>; 933 934 /** 935 * Sets breakpoint on particular operation with DOM. 936 */ 937 setDOMBreakpoint(params: Protocol.DOMDebugger.SetDOMBreakpointRequest): Promise<void>; 938 939 /** 940 * Sets breakpoint on particular DOM event. 941 */ 942 setEventListenerBreakpoint(params: Protocol.DOMDebugger.SetEventListenerBreakpointRequest): Promise<void>; 943 944 /** 945 * Sets breakpoint on particular native event. 946 */ 947 setInstrumentationBreakpoint(params: Protocol.DOMDebugger.SetInstrumentationBreakpointRequest): Promise<void>; 948 949 /** 950 * Sets breakpoint on XMLHttpRequest. 951 */ 952 setXHRBreakpoint(params: Protocol.DOMDebugger.SetXHRBreakpointRequest): Promise<void>; 953 } 954 955 export interface DOMSnapshotApi { 956 /** 957 * Disables DOM snapshot agent for the given page. 958 */ 959 disable(): Promise<void>; 960 961 /** 962 * Enables DOM snapshot agent for the given page. 963 */ 964 enable(): Promise<void>; 965 966 /** 967 * Returns a document snapshot, including the full DOM tree of the root node (including iframes, 968 * template contents, and imported documents) in a flattened array, as well as layout and 969 * white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is 970 * flattened. 971 */ 972 getSnapshot(params: Protocol.DOMSnapshot.GetSnapshotRequest): Promise<Protocol.DOMSnapshot.GetSnapshotResponse>; 973 974 /** 975 * Returns a document snapshot, including the full DOM tree of the root node (including iframes, 976 * template contents, and imported documents) in a flattened array, as well as layout and 977 * white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is 978 * flattened. 979 */ 980 captureSnapshot(params: Protocol.DOMSnapshot.CaptureSnapshotRequest): 981 Promise<Protocol.DOMSnapshot.CaptureSnapshotResponse>; 982 } 983 984 export interface DOMStorageApi { 985 clear(params: Protocol.DOMStorage.ClearRequest): Promise<void>; 986 987 /** 988 * Disables storage tracking, prevents storage events from being sent to the client. 989 */ 990 disable(): Promise<void>; 991 992 /** 993 * Enables storage tracking, storage events will now be delivered to the client. 994 */ 995 enable(): Promise<void>; 996 997 getDOMStorageItems(params: Protocol.DOMStorage.GetDOMStorageItemsRequest): 998 Promise<Protocol.DOMStorage.GetDOMStorageItemsResponse>; 999 1000 removeDOMStorageItem(params: Protocol.DOMStorage.RemoveDOMStorageItemRequest): Promise<void>; 1001 1002 setDOMStorageItem(params: Protocol.DOMStorage.SetDOMStorageItemRequest): Promise<void>; 1003 1004 on(event: 'domStorageItemAdded', listener: (params: Protocol.DOMStorage.DomStorageItemAddedEvent) => void): void; 1005 1006 on(event: 'domStorageItemRemoved', 1007 listener: (params: Protocol.DOMStorage.DomStorageItemRemovedEvent) => void): void; 1008 1009 on(event: 'domStorageItemUpdated', 1010 listener: (params: Protocol.DOMStorage.DomStorageItemUpdatedEvent) => void): void; 1011 1012 on(event: 'domStorageItemsCleared', 1013 listener: (params: Protocol.DOMStorage.DomStorageItemsClearedEvent) => void): void; 1014 } 1015 1016 export interface DatabaseApi { 1017 /** 1018 * Disables database tracking, prevents database events from being sent to the client. 1019 */ 1020 disable(): Promise<void>; 1021 1022 /** 1023 * Enables database tracking, database events will now be delivered to the client. 1024 */ 1025 enable(): Promise<void>; 1026 1027 executeSQL(params: Protocol.Database.ExecuteSQLRequest): Promise<Protocol.Database.ExecuteSQLResponse>; 1028 1029 getDatabaseTableNames(params: Protocol.Database.GetDatabaseTableNamesRequest): 1030 Promise<Protocol.Database.GetDatabaseTableNamesResponse>; 1031 1032 on(event: 'addDatabase', listener: (params: Protocol.Database.AddDatabaseEvent) => void): void; 1033 } 1034 1035 export interface DeviceOrientationApi { 1036 /** 1037 * Clears the overridden Device Orientation. 1038 */ 1039 clearDeviceOrientationOverride(): Promise<void>; 1040 1041 /** 1042 * Overrides the Device Orientation. 1043 */ 1044 setDeviceOrientationOverride(params: Protocol.DeviceOrientation.SetDeviceOrientationOverrideRequest): Promise<void>; 1045 } 1046 1047 export interface EmulationApi { 1048 /** 1049 * Tells whether emulation is supported. 1050 */ 1051 canEmulate(): Promise<Protocol.Emulation.CanEmulateResponse>; 1052 1053 /** 1054 * Clears the overriden device metrics. 1055 */ 1056 clearDeviceMetricsOverride(): Promise<void>; 1057 1058 /** 1059 * Clears the overriden Geolocation Position and Error. 1060 */ 1061 clearGeolocationOverride(): Promise<void>; 1062 1063 /** 1064 * Requests that page scale factor is reset to initial values. 1065 */ 1066 resetPageScaleFactor(): Promise<void>; 1067 1068 /** 1069 * Enables or disables simulating a focused and active page. 1070 */ 1071 setFocusEmulationEnabled(params: Protocol.Emulation.SetFocusEmulationEnabledRequest): Promise<void>; 1072 1073 /** 1074 * Enables CPU throttling to emulate slow CPUs. 1075 */ 1076 setCPUThrottlingRate(params: Protocol.Emulation.SetCPUThrottlingRateRequest): Promise<void>; 1077 1078 /** 1079 * Sets or clears an override of the default background color of the frame. This override is used 1080 * if the content does not specify one. 1081 */ 1082 setDefaultBackgroundColorOverride(params: Protocol.Emulation.SetDefaultBackgroundColorOverrideRequest): 1083 Promise<void>; 1084 1085 /** 1086 * Overrides the values of device screen dimensions (window.screen.width, window.screen.height, 1087 * window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media 1088 * query results). 1089 */ 1090 setDeviceMetricsOverride(params: Protocol.Emulation.SetDeviceMetricsOverrideRequest): Promise<void>; 1091 1092 setScrollbarsHidden(params: Protocol.Emulation.SetScrollbarsHiddenRequest): Promise<void>; 1093 1094 setDocumentCookieDisabled(params: Protocol.Emulation.SetDocumentCookieDisabledRequest): Promise<void>; 1095 1096 setEmitTouchEventsForMouse(params: Protocol.Emulation.SetEmitTouchEventsForMouseRequest): Promise<void>; 1097 1098 /** 1099 * Emulates the given media type or media feature for CSS media queries. 1100 */ 1101 setEmulatedMedia(params: Protocol.Emulation.SetEmulatedMediaRequest): Promise<void>; 1102 1103 /** 1104 * Emulates the given vision deficiency. 1105 */ 1106 setEmulatedVisionDeficiency(params: Protocol.Emulation.SetEmulatedVisionDeficiencyRequest): Promise<void>; 1107 1108 /** 1109 * Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position 1110 * unavailable. 1111 */ 1112 setGeolocationOverride(params: Protocol.Emulation.SetGeolocationOverrideRequest): Promise<void>; 1113 1114 /** 1115 * Overrides value returned by the javascript navigator object. 1116 */ 1117 setNavigatorOverrides(params: Protocol.Emulation.SetNavigatorOverridesRequest): Promise<void>; 1118 1119 /** 1120 * Sets a specified page scale factor. 1121 */ 1122 setPageScaleFactor(params: Protocol.Emulation.SetPageScaleFactorRequest): Promise<void>; 1123 1124 /** 1125 * Switches script execution in the page. 1126 */ 1127 setScriptExecutionDisabled(params: Protocol.Emulation.SetScriptExecutionDisabledRequest): Promise<void>; 1128 1129 /** 1130 * Enables touch on platforms which do not support them. 1131 */ 1132 setTouchEmulationEnabled(params: Protocol.Emulation.SetTouchEmulationEnabledRequest): Promise<void>; 1133 1134 /** 1135 * Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets 1136 * the current virtual time policy. Note this supersedes any previous time budget. 1137 */ 1138 setVirtualTimePolicy(params: Protocol.Emulation.SetVirtualTimePolicyRequest): 1139 Promise<Protocol.Emulation.SetVirtualTimePolicyResponse>; 1140 1141 /** 1142 * Overrides default host system locale with the specified one. 1143 */ 1144 setLocaleOverride(params: Protocol.Emulation.SetLocaleOverrideRequest): Promise<void>; 1145 1146 /** 1147 * Overrides default host system timezone with the specified one. 1148 */ 1149 setTimezoneOverride(params: Protocol.Emulation.SetTimezoneOverrideRequest): Promise<void>; 1150 1151 /** 1152 * Resizes the frame/viewport of the page. Note that this does not affect the frame's container 1153 * (e.g. browser window). Can be used to produce screenshots of the specified size. Not supported 1154 * on Android. 1155 */ 1156 setVisibleSize(params: Protocol.Emulation.SetVisibleSizeRequest): Promise<void>; 1157 1158 /** 1159 * Allows overriding user agent with the given string. 1160 */ 1161 setUserAgentOverride(params: Protocol.Emulation.SetUserAgentOverrideRequest): Promise<void>; 1162 1163 /** 1164 * Notification sent after the virtual time budget for the current VirtualTimePolicy has run out. 1165 */ 1166 on(event: 'virtualTimeBudgetExpired', listener: () => void): void; 1167 } 1168 1169 export interface HeadlessExperimentalApi { 1170 /** 1171 * Sends a BeginFrame to the target and returns when the frame was completed. Optionally captures a 1172 * screenshot from the resulting frame. Requires that the target was created with enabled 1173 * BeginFrameControl. Designed for use with --run-all-compositor-stages-before-draw, see also 1174 * https://goo.gl/3zHXhB for more background. 1175 */ 1176 beginFrame(params: Protocol.HeadlessExperimental.BeginFrameRequest): 1177 Promise<Protocol.HeadlessExperimental.BeginFrameResponse>; 1178 1179 /** 1180 * Disables headless events for the target. 1181 */ 1182 disable(): Promise<void>; 1183 1184 /** 1185 * Enables headless events for the target. 1186 */ 1187 enable(): Promise<void>; 1188 1189 /** 1190 * Issued when the target starts or stops needing BeginFrames. 1191 * Deprecated. Issue beginFrame unconditionally instead and use result from 1192 * beginFrame to detect whether the frames were suppressed. 1193 */ 1194 on(event: 'needsBeginFramesChanged', 1195 listener: (params: Protocol.HeadlessExperimental.NeedsBeginFramesChangedEvent) => void): void; 1196 } 1197 1198 // eslint thinks this is us prefixing our interfaces but it's not! 1199 // eslint-disable-next-line @typescript-eslint/interface-name-prefix 1200 export interface IOApi { 1201 /** 1202 * Close the stream, discard any temporary backing storage. 1203 */ 1204 close(params: Protocol.IO.CloseRequest): Promise<void>; 1205 1206 /** 1207 * Read a chunk of the stream 1208 */ 1209 read(params: Protocol.IO.ReadRequest): Promise<Protocol.IO.ReadResponse>; 1210 1211 /** 1212 * Return UUID of Blob object specified by a remote object id. 1213 */ 1214 resolveBlob(params: Protocol.IO.ResolveBlobRequest): Promise<Protocol.IO.ResolveBlobResponse>; 1215 } 1216 1217 // eslint thinks this is us prefixing our interfaces but it's not! 1218 // eslint-disable-next-line @typescript-eslint/interface-name-prefix 1219 export interface IndexedDBApi { 1220 /** 1221 * Clears all entries from an object store. 1222 */ 1223 clearObjectStore(params: Protocol.IndexedDB.ClearObjectStoreRequest): Promise<void>; 1224 1225 /** 1226 * Deletes a database. 1227 */ 1228 deleteDatabase(params: Protocol.IndexedDB.DeleteDatabaseRequest): Promise<void>; 1229 1230 /** 1231 * Delete a range of entries from an object store 1232 */ 1233 deleteObjectStoreEntries(params: Protocol.IndexedDB.DeleteObjectStoreEntriesRequest): Promise<void>; 1234 1235 /** 1236 * Disables events from backend. 1237 */ 1238 disable(): Promise<void>; 1239 1240 /** 1241 * Enables events from backend. 1242 */ 1243 enable(): Promise<void>; 1244 1245 /** 1246 * Requests data from object store or index. 1247 */ 1248 requestData(params: Protocol.IndexedDB.RequestDataRequest): Promise<Protocol.IndexedDB.RequestDataResponse>; 1249 1250 /** 1251 * Gets metadata of an object store 1252 */ 1253 getMetadata(params: Protocol.IndexedDB.GetMetadataRequest): Promise<Protocol.IndexedDB.GetMetadataResponse>; 1254 1255 /** 1256 * Requests database with given name in given frame. 1257 */ 1258 requestDatabase(params: Protocol.IndexedDB.RequestDatabaseRequest): 1259 Promise<Protocol.IndexedDB.RequestDatabaseResponse>; 1260 1261 /** 1262 * Requests database names for given security origin. 1263 */ 1264 requestDatabaseNames(params: Protocol.IndexedDB.RequestDatabaseNamesRequest): 1265 Promise<Protocol.IndexedDB.RequestDatabaseNamesResponse>; 1266 } 1267 1268 // eslint thinks this is us prefixing our interfaces but it's not! 1269 // eslint-disable-next-line @typescript-eslint/interface-name-prefix 1270 export interface InputApi { 1271 /** 1272 * Dispatches a key event to the page. 1273 */ 1274 dispatchKeyEvent(params: Protocol.Input.DispatchKeyEventRequest): Promise<void>; 1275 1276 /** 1277 * This method emulates inserting text that doesn't come from a key press, 1278 * for example an emoji keyboard or an IME. 1279 */ 1280 insertText(params: Protocol.Input.InsertTextRequest): Promise<void>; 1281 1282 /** 1283 * Dispatches a mouse event to the page. 1284 */ 1285 dispatchMouseEvent(params: Protocol.Input.DispatchMouseEventRequest): Promise<void>; 1286 1287 /** 1288 * Dispatches a touch event to the page. 1289 */ 1290 dispatchTouchEvent(params: Protocol.Input.DispatchTouchEventRequest): Promise<void>; 1291 1292 /** 1293 * Emulates touch event from the mouse event parameters. 1294 */ 1295 emulateTouchFromMouseEvent(params: Protocol.Input.EmulateTouchFromMouseEventRequest): Promise<void>; 1296 1297 /** 1298 * Ignores input events (useful while auditing page). 1299 */ 1300 setIgnoreInputEvents(params: Protocol.Input.SetIgnoreInputEventsRequest): Promise<void>; 1301 1302 /** 1303 * Synthesizes a pinch gesture over a time period by issuing appropriate touch events. 1304 */ 1305 synthesizePinchGesture(params: Protocol.Input.SynthesizePinchGestureRequest): Promise<void>; 1306 1307 /** 1308 * Synthesizes a scroll gesture over a time period by issuing appropriate touch events. 1309 */ 1310 synthesizeScrollGesture(params: Protocol.Input.SynthesizeScrollGestureRequest): Promise<void>; 1311 1312 /** 1313 * Synthesizes a tap gesture over a time period by issuing appropriate touch events. 1314 */ 1315 synthesizeTapGesture(params: Protocol.Input.SynthesizeTapGestureRequest): Promise<void>; 1316 } 1317 1318 // eslint thinks this is us prefixing our interfaces but it's not! 1319 // eslint-disable-next-line @typescript-eslint/interface-name-prefix 1320 export interface InspectorApi { 1321 /** 1322 * Disables inspector domain notifications. 1323 */ 1324 disable(): Promise<void>; 1325 1326 /** 1327 * Enables inspector domain notifications. 1328 */ 1329 enable(): Promise<void>; 1330 1331 /** 1332 * Fired when remote debugging connection is about to be terminated. Contains detach reason. 1333 */ 1334 on(event: 'detached', listener: (params: Protocol.Inspector.DetachedEvent) => void): void; 1335 1336 /** 1337 * Fired when debugging target has crashed 1338 */ 1339 on(event: 'targetCrashed', listener: () => void): void; 1340 1341 /** 1342 * Fired when debugging target has reloaded after crash 1343 */ 1344 on(event: 'targetReloadedAfterCrash', listener: () => void): void; 1345 } 1346 1347 export interface LayerTreeApi { 1348 /** 1349 * Provides the reasons why the given layer was composited. 1350 */ 1351 compositingReasons(params: Protocol.LayerTree.CompositingReasonsRequest): 1352 Promise<Protocol.LayerTree.CompositingReasonsResponse>; 1353 1354 /** 1355 * Disables compositing tree inspection. 1356 */ 1357 disable(): Promise<void>; 1358 1359 /** 1360 * Enables compositing tree inspection. 1361 */ 1362 enable(): Promise<void>; 1363 1364 /** 1365 * Returns the snapshot identifier. 1366 */ 1367 loadSnapshot(params: Protocol.LayerTree.LoadSnapshotRequest): Promise<Protocol.LayerTree.LoadSnapshotResponse>; 1368 1369 /** 1370 * Returns the layer snapshot identifier. 1371 */ 1372 makeSnapshot(params: Protocol.LayerTree.MakeSnapshotRequest): Promise<Protocol.LayerTree.MakeSnapshotResponse>; 1373 1374 profileSnapshot(params: Protocol.LayerTree.ProfileSnapshotRequest): 1375 Promise<Protocol.LayerTree.ProfileSnapshotResponse>; 1376 1377 /** 1378 * Releases layer snapshot captured by the back-end. 1379 */ 1380 releaseSnapshot(params: Protocol.LayerTree.ReleaseSnapshotRequest): Promise<void>; 1381 1382 /** 1383 * Replays the layer snapshot and returns the resulting bitmap. 1384 */ 1385 replaySnapshot(params: Protocol.LayerTree.ReplaySnapshotRequest): 1386 Promise<Protocol.LayerTree.ReplaySnapshotResponse>; 1387 1388 /** 1389 * Replays the layer snapshot and returns canvas log. 1390 */ 1391 snapshotCommandLog(params: Protocol.LayerTree.SnapshotCommandLogRequest): 1392 Promise<Protocol.LayerTree.SnapshotCommandLogResponse>; 1393 1394 on(event: 'layerPainted', listener: (params: Protocol.LayerTree.LayerPaintedEvent) => void): void; 1395 1396 on(event: 'layerTreeDidChange', listener: (params: Protocol.LayerTree.LayerTreeDidChangeEvent) => void): void; 1397 } 1398 1399 export interface LogApi { 1400 /** 1401 * Clears the log. 1402 */ 1403 clear(): Promise<void>; 1404 1405 /** 1406 * Disables log domain, prevents further log entries from being reported to the client. 1407 */ 1408 disable(): Promise<void>; 1409 1410 /** 1411 * Enables log domain, sends the entries collected so far to the client by means of the 1412 * `entryAdded` notification. 1413 */ 1414 enable(): Promise<void>; 1415 1416 /** 1417 * start violation reporting. 1418 */ 1419 startViolationsReport(params: Protocol.Log.StartViolationsReportRequest): Promise<void>; 1420 1421 /** 1422 * Stop violation reporting. 1423 */ 1424 stopViolationsReport(): Promise<void>; 1425 1426 /** 1427 * Issued when new message was logged. 1428 */ 1429 on(event: 'entryAdded', listener: (params: Protocol.Log.EntryAddedEvent) => void): void; 1430 } 1431 1432 export interface MemoryApi { 1433 getDOMCounters(): Promise<Protocol.Memory.GetDOMCountersResponse>; 1434 1435 prepareForLeakDetection(): Promise<void>; 1436 1437 /** 1438 * Simulate OomIntervention by purging V8 memory. 1439 */ 1440 forciblyPurgeJavaScriptMemory(): Promise<void>; 1441 1442 /** 1443 * Enable/disable suppressing memory pressure notifications in all processes. 1444 */ 1445 setPressureNotificationsSuppressed(params: Protocol.Memory.SetPressureNotificationsSuppressedRequest): 1446 Promise<void>; 1447 1448 /** 1449 * Simulate a memory pressure notification in all processes. 1450 */ 1451 simulatePressureNotification(params: Protocol.Memory.SimulatePressureNotificationRequest): Promise<void>; 1452 1453 /** 1454 * Start collecting native memory profile. 1455 */ 1456 startSampling(params: Protocol.Memory.StartSamplingRequest): Promise<void>; 1457 1458 /** 1459 * Stop collecting native memory profile. 1460 */ 1461 stopSampling(): Promise<void>; 1462 1463 /** 1464 * Retrieve native memory allocations profile 1465 * collected since renderer process startup. 1466 */ 1467 getAllTimeSamplingProfile(): Promise<Protocol.Memory.GetAllTimeSamplingProfileResponse>; 1468 1469 /** 1470 * Retrieve native memory allocations profile 1471 * collected since browser process startup. 1472 */ 1473 getBrowserSamplingProfile(): Promise<Protocol.Memory.GetBrowserSamplingProfileResponse>; 1474 1475 /** 1476 * Retrieve native memory allocations profile collected since last 1477 * `startSampling` call. 1478 */ 1479 getSamplingProfile(): Promise<Protocol.Memory.GetSamplingProfileResponse>; 1480 } 1481 1482 export interface NetworkApi { 1483 /** 1484 * Tells whether clearing browser cache is supported. 1485 */ 1486 canClearBrowserCache(): Promise<Protocol.Network.CanClearBrowserCacheResponse>; 1487 1488 /** 1489 * Tells whether clearing browser cookies is supported. 1490 */ 1491 canClearBrowserCookies(): Promise<Protocol.Network.CanClearBrowserCookiesResponse>; 1492 1493 /** 1494 * Tells whether emulation of network conditions is supported. 1495 */ 1496 canEmulateNetworkConditions(): Promise<Protocol.Network.CanEmulateNetworkConditionsResponse>; 1497 1498 /** 1499 * Clears browser cache. 1500 */ 1501 clearBrowserCache(): Promise<void>; 1502 1503 /** 1504 * Clears browser cookies. 1505 */ 1506 clearBrowserCookies(): Promise<void>; 1507 1508 /** 1509 * Response to Network.requestIntercepted which either modifies the request to continue with any 1510 * modifications, or blocks it, or completes it with the provided response bytes. If a network 1511 * fetch occurs as a result which encounters a redirect an additional Network.requestIntercepted 1512 * event will be sent with the same InterceptionId. 1513 * Deprecated, use Fetch.continueRequest, Fetch.fulfillRequest and Fetch.failRequest instead. 1514 */ 1515 continueInterceptedRequest(params: Protocol.Network.ContinueInterceptedRequestRequest): Promise<void>; 1516 1517 /** 1518 * Deletes browser cookies with matching name and url or domain/path pair. 1519 */ 1520 deleteCookies(params: Protocol.Network.DeleteCookiesRequest): Promise<void>; 1521 1522 /** 1523 * Disables network tracking, prevents network events from being sent to the client. 1524 */ 1525 disable(): Promise<void>; 1526 1527 /** 1528 * Activates emulation of network conditions. 1529 */ 1530 emulateNetworkConditions(params: Protocol.Network.EmulateNetworkConditionsRequest): Promise<void>; 1531 1532 /** 1533 * Enables network tracking, network events will now be delivered to the client. 1534 */ 1535 enable(params: Protocol.Network.EnableRequest): Promise<void>; 1536 1537 /** 1538 * Returns all browser cookies. Depending on the backend support, will return detailed cookie 1539 * information in the `cookies` field. 1540 */ 1541 getAllCookies(): Promise<Protocol.Network.GetAllCookiesResponse>; 1542 1543 /** 1544 * Returns the DER-encoded certificate. 1545 */ 1546 getCertificate(params: Protocol.Network.GetCertificateRequest): Promise<Protocol.Network.GetCertificateResponse>; 1547 1548 /** 1549 * Returns all browser cookies for the current URL. Depending on the backend support, will return 1550 * detailed cookie information in the `cookies` field. 1551 */ 1552 getCookies(params: Protocol.Network.GetCookiesRequest): Promise<Protocol.Network.GetCookiesResponse>; 1553 1554 /** 1555 * Returns content served for the given request. 1556 */ 1557 getResponseBody(params: Protocol.Network.GetResponseBodyRequest): Promise<Protocol.Network.GetResponseBodyResponse>; 1558 1559 /** 1560 * Returns post data sent with the request. Returns an error when no data was sent with the request. 1561 */ 1562 getRequestPostData(params: Protocol.Network.GetRequestPostDataRequest): 1563 Promise<Protocol.Network.GetRequestPostDataResponse>; 1564 1565 /** 1566 * Returns content served for the given currently intercepted request. 1567 */ 1568 getResponseBodyForInterception(params: Protocol.Network.GetResponseBodyForInterceptionRequest): 1569 Promise<Protocol.Network.GetResponseBodyForInterceptionResponse>; 1570 1571 /** 1572 * Returns a handle to the stream representing the response body. Note that after this command, 1573 * the intercepted request can't be continued as is -- you either need to cancel it or to provide 1574 * the response body. The stream only supports sequential read, IO.read will fail if the position 1575 * is specified. 1576 */ 1577 takeResponseBodyForInterceptionAsStream(params: Protocol.Network.TakeResponseBodyForInterceptionAsStreamRequest): 1578 Promise<Protocol.Network.TakeResponseBodyForInterceptionAsStreamResponse>; 1579 1580 /** 1581 * This method sends a new XMLHttpRequest which is identical to the original one. The following 1582 * parameters should be identical: method, url, async, request body, extra headers, withCredentials 1583 * attribute, user, password. 1584 */ 1585 replayXHR(params: Protocol.Network.ReplayXHRRequest): Promise<void>; 1586 1587 /** 1588 * Searches for given string in response content. 1589 */ 1590 searchInResponseBody(params: Protocol.Network.SearchInResponseBodyRequest): 1591 Promise<Protocol.Network.SearchInResponseBodyResponse>; 1592 1593 /** 1594 * Blocks URLs from loading. 1595 */ 1596 setBlockedURLs(params: Protocol.Network.SetBlockedURLsRequest): Promise<void>; 1597 1598 /** 1599 * Toggles ignoring of service worker for each request. 1600 */ 1601 setBypassServiceWorker(params: Protocol.Network.SetBypassServiceWorkerRequest): Promise<void>; 1602 1603 /** 1604 * Toggles ignoring cache for each request. If `true`, cache will not be used. 1605 */ 1606 setCacheDisabled(params: Protocol.Network.SetCacheDisabledRequest): Promise<void>; 1607 1608 /** 1609 * Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist. 1610 */ 1611 setCookie(params: Protocol.Network.SetCookieRequest): Promise<Protocol.Network.SetCookieResponse>; 1612 1613 /** 1614 * Sets given cookies. 1615 */ 1616 setCookies(params: Protocol.Network.SetCookiesRequest): Promise<void>; 1617 1618 /** 1619 * For testing. 1620 */ 1621 setDataSizeLimitsForTest(params: Protocol.Network.SetDataSizeLimitsForTestRequest): Promise<void>; 1622 1623 /** 1624 * Specifies whether to always send extra HTTP headers with the requests from this page. 1625 */ 1626 setExtraHTTPHeaders(params: Protocol.Network.SetExtraHTTPHeadersRequest): Promise<void>; 1627 1628 /** 1629 * Sets the requests to intercept that match the provided patterns and optionally resource types. 1630 * Deprecated, please use Fetch.enable instead. 1631 */ 1632 setRequestInterception(params: Protocol.Network.SetRequestInterceptionRequest): Promise<void>; 1633 1634 /** 1635 * Allows overriding user agent with the given string. 1636 */ 1637 setUserAgentOverride(params: Protocol.Network.SetUserAgentOverrideRequest): Promise<void>; 1638 1639 /** 1640 * Fired when data chunk was received over the network. 1641 */ 1642 on(event: 'dataReceived', listener: (params: Protocol.Network.DataReceivedEvent) => void): void; 1643 1644 /** 1645 * Fired when EventSource message is received. 1646 */ 1647 on(event: 'eventSourceMessageReceived', 1648 listener: (params: Protocol.Network.EventSourceMessageReceivedEvent) => void): void; 1649 1650 /** 1651 * Fired when HTTP request has failed to load. 1652 */ 1653 on(event: 'loadingFailed', listener: (params: Protocol.Network.LoadingFailedEvent) => void): void; 1654 1655 /** 1656 * Fired when HTTP request has finished loading. 1657 */ 1658 on(event: 'loadingFinished', listener: (params: Protocol.Network.LoadingFinishedEvent) => void): void; 1659 1660 /** 1661 * Details of an intercepted HTTP request, which must be either allowed, blocked, modified or 1662 * mocked. 1663 * Deprecated, use Fetch.requestPaused instead. 1664 */ 1665 on(event: 'requestIntercepted', listener: (params: Protocol.Network.RequestInterceptedEvent) => void): void; 1666 1667 /** 1668 * Fired if request ended up loading from cache. 1669 */ 1670 on(event: 'requestServedFromCache', listener: (params: Protocol.Network.RequestServedFromCacheEvent) => void): void; 1671 1672 /** 1673 * Fired when page is about to send HTTP request. 1674 */ 1675 on(event: 'requestWillBeSent', listener: (params: Protocol.Network.RequestWillBeSentEvent) => void): void; 1676 1677 /** 1678 * Fired when resource loading priority is changed 1679 */ 1680 on(event: 'resourceChangedPriority', 1681 listener: (params: Protocol.Network.ResourceChangedPriorityEvent) => void): void; 1682 1683 /** 1684 * Fired when a signed exchange was received over the network 1685 */ 1686 on(event: 'signedExchangeReceived', listener: (params: Protocol.Network.SignedExchangeReceivedEvent) => void): void; 1687 1688 /** 1689 * Fired when HTTP response is available. 1690 */ 1691 on(event: 'responseReceived', listener: (params: Protocol.Network.ResponseReceivedEvent) => void): void; 1692 1693 /** 1694 * Fired when WebSocket is closed. 1695 */ 1696 on(event: 'webSocketClosed', listener: (params: Protocol.Network.WebSocketClosedEvent) => void): void; 1697 1698 /** 1699 * Fired upon WebSocket creation. 1700 */ 1701 on(event: 'webSocketCreated', listener: (params: Protocol.Network.WebSocketCreatedEvent) => void): void; 1702 1703 /** 1704 * Fired when WebSocket message error occurs. 1705 */ 1706 on(event: 'webSocketFrameError', listener: (params: Protocol.Network.WebSocketFrameErrorEvent) => void): void; 1707 1708 /** 1709 * Fired when WebSocket message is received. 1710 */ 1711 on(event: 'webSocketFrameReceived', listener: (params: Protocol.Network.WebSocketFrameReceivedEvent) => void): void; 1712 1713 /** 1714 * Fired when WebSocket message is sent. 1715 */ 1716 on(event: 'webSocketFrameSent', listener: (params: Protocol.Network.WebSocketFrameSentEvent) => void): void; 1717 1718 /** 1719 * Fired when WebSocket handshake response becomes available. 1720 */ 1721 on(event: 'webSocketHandshakeResponseReceived', 1722 listener: (params: Protocol.Network.WebSocketHandshakeResponseReceivedEvent) => void): void; 1723 1724 /** 1725 * Fired when WebSocket is about to initiate handshake. 1726 */ 1727 on(event: 'webSocketWillSendHandshakeRequest', 1728 listener: (params: Protocol.Network.WebSocketWillSendHandshakeRequestEvent) => void): void; 1729 1730 /** 1731 * Fired when additional information about a requestWillBeSent event is available from the 1732 * network stack. Not every requestWillBeSent event will have an additional 1733 * requestWillBeSentExtraInfo fired for it, and there is no guarantee whether requestWillBeSent 1734 * or requestWillBeSentExtraInfo will be fired first for the same request. 1735 */ 1736 on(event: 'requestWillBeSentExtraInfo', 1737 listener: (params: Protocol.Network.RequestWillBeSentExtraInfoEvent) => void): void; 1738 1739 /** 1740 * Fired when additional information about a responseReceived event is available from the network 1741 * stack. Not every responseReceived event will have an additional responseReceivedExtraInfo for 1742 * it, and responseReceivedExtraInfo may be fired before or after responseReceived. 1743 */ 1744 on(event: 'responseReceivedExtraInfo', 1745 listener: (params: Protocol.Network.ResponseReceivedExtraInfoEvent) => void): void; 1746 } 1747 1748 export interface OverlayApi { 1749 /** 1750 * Disables domain notifications. 1751 */ 1752 disable(): Promise<void>; 1753 1754 /** 1755 * Enables domain notifications. 1756 */ 1757 enable(): Promise<void>; 1758 1759 /** 1760 * For testing. 1761 */ 1762 getHighlightObjectForTest(params: Protocol.Overlay.GetHighlightObjectForTestRequest): 1763 Promise<Protocol.Overlay.GetHighlightObjectForTestResponse>; 1764 1765 /** 1766 * Hides any highlight. 1767 */ 1768 hideHighlight(): Promise<void>; 1769 1770 /** 1771 * Highlights owner element of the frame with given id. 1772 */ 1773 highlightFrame(params: Protocol.Overlay.HighlightFrameRequest): Promise<void>; 1774 1775 /** 1776 * Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or 1777 * objectId must be specified. 1778 */ 1779 highlightNode(params: Protocol.Overlay.HighlightNodeRequest): Promise<void>; 1780 1781 /** 1782 * Highlights given quad. Coordinates are absolute with respect to the main frame viewport. 1783 */ 1784 highlightQuad(params: Protocol.Overlay.HighlightQuadRequest): Promise<void>; 1785 1786 /** 1787 * Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport. 1788 */ 1789 highlightRect(params: Protocol.Overlay.HighlightRectRequest): Promise<void>; 1790 1791 /** 1792 * Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. 1793 * Backend then generates 'inspectNodeRequested' event upon element selection. 1794 */ 1795 setInspectMode(params: Protocol.Overlay.SetInspectModeRequest): Promise<void>; 1796 1797 /** 1798 * Highlights owner element of all frames detected to be ads. 1799 */ 1800 setShowAdHighlights(params: Protocol.Overlay.SetShowAdHighlightsRequest): Promise<void>; 1801 1802 setPausedInDebuggerMessage(params: Protocol.Overlay.SetPausedInDebuggerMessageRequest): Promise<void>; 1803 1804 /** 1805 * Requests that backend shows debug borders on layers 1806 */ 1807 setShowDebugBorders(params: Protocol.Overlay.SetShowDebugBordersRequest): Promise<void>; 1808 1809 /** 1810 * Requests that backend shows the FPS counter 1811 */ 1812 setShowFPSCounter(params: Protocol.Overlay.SetShowFPSCounterRequest): Promise<void>; 1813 1814 /** 1815 * Requests that backend shows paint rectangles 1816 */ 1817 setShowPaintRects(params: Protocol.Overlay.SetShowPaintRectsRequest): Promise<void>; 1818 1819 /** 1820 * Requests that backend shows layout shift regions 1821 */ 1822 setShowLayoutShiftRegions(params: Protocol.Overlay.SetShowLayoutShiftRegionsRequest): Promise<void>; 1823 1824 /** 1825 * Requests that backend shows scroll bottleneck rects 1826 */ 1827 setShowScrollBottleneckRects(params: Protocol.Overlay.SetShowScrollBottleneckRectsRequest): Promise<void>; 1828 1829 /** 1830 * Requests that backend shows hit-test borders on layers 1831 */ 1832 setShowHitTestBorders(params: Protocol.Overlay.SetShowHitTestBordersRequest): Promise<void>; 1833 1834 /** 1835 * Paints viewport size upon main frame resize. 1836 */ 1837 setShowViewportSizeOnResize(params: Protocol.Overlay.SetShowViewportSizeOnResizeRequest): Promise<void>; 1838 1839 /** 1840 * Fired when the node should be inspected. This happens after call to `setInspectMode` or when 1841 * user manually inspects an element. 1842 */ 1843 on(event: 'inspectNodeRequested', listener: (params: Protocol.Overlay.InspectNodeRequestedEvent) => void): void; 1844 1845 /** 1846 * Fired when the node should be highlighted. This happens after call to `setInspectMode`. 1847 */ 1848 on(event: 'nodeHighlightRequested', listener: (params: Protocol.Overlay.NodeHighlightRequestedEvent) => void): void; 1849 1850 /** 1851 * Fired when user asks to capture screenshot of some area on the page. 1852 */ 1853 on(event: 'screenshotRequested', listener: (params: Protocol.Overlay.ScreenshotRequestedEvent) => void): void; 1854 1855 /** 1856 * Fired when user cancels the inspect mode. 1857 */ 1858 on(event: 'inspectModeCanceled', listener: () => void): void; 1859 } 1860 1861 export interface PageApi { 1862 /** 1863 * Deprecated, please use addScriptToEvaluateOnNewDocument instead. 1864 */ 1865 addScriptToEvaluateOnLoad(params: Protocol.Page.AddScriptToEvaluateOnLoadRequest): 1866 Promise<Protocol.Page.AddScriptToEvaluateOnLoadResponse>; 1867 1868 /** 1869 * Evaluates given script in every frame upon creation (before loading frame's scripts). 1870 */ 1871 addScriptToEvaluateOnNewDocument(params: Protocol.Page.AddScriptToEvaluateOnNewDocumentRequest): 1872 Promise<Protocol.Page.AddScriptToEvaluateOnNewDocumentResponse>; 1873 1874 /** 1875 * Brings page to front (activates tab). 1876 */ 1877 bringToFront(): Promise<void>; 1878 1879 /** 1880 * Capture page screenshot. 1881 */ 1882 captureScreenshot(params: Protocol.Page.CaptureScreenshotRequest): Promise<Protocol.Page.CaptureScreenshotResponse>; 1883 1884 /** 1885 * Returns a snapshot of the page as a string. For MHTML format, the serialization includes 1886 * iframes, shadow DOM, external resources, and element-inline styles. 1887 */ 1888 captureSnapshot(params: Protocol.Page.CaptureSnapshotRequest): Promise<Protocol.Page.CaptureSnapshotResponse>; 1889 1890 /** 1891 * Clears the overriden device metrics. 1892 */ 1893 clearDeviceMetricsOverride(): Promise<void>; 1894 1895 /** 1896 * Clears the overridden Device Orientation. 1897 */ 1898 clearDeviceOrientationOverride(): Promise<void>; 1899 1900 /** 1901 * Clears the overriden Geolocation Position and Error. 1902 */ 1903 clearGeolocationOverride(): Promise<void>; 1904 1905 /** 1906 * Creates an isolated world for the given frame. 1907 */ 1908 createIsolatedWorld(params: Protocol.Page.CreateIsolatedWorldRequest): 1909 Promise<Protocol.Page.CreateIsolatedWorldResponse>; 1910 1911 /** 1912 * Deletes browser cookie with given name, domain and path. 1913 */ 1914 deleteCookie(params: Protocol.Page.DeleteCookieRequest): Promise<void>; 1915 1916 /** 1917 * Disables page domain notifications. 1918 */ 1919 disable(): Promise<void>; 1920 1921 /** 1922 * Enables page domain notifications. 1923 */ 1924 enable(): Promise<void>; 1925 1926 getAppManifest(): Promise<Protocol.Page.GetAppManifestResponse>; 1927 1928 getInstallabilityErrors(): Promise<Protocol.Page.GetInstallabilityErrorsResponse>; 1929 1930 getManifestIcons(): Promise<Protocol.Page.GetManifestIconsResponse>; 1931 1932 /** 1933 * Returns all browser cookies. Depending on the backend support, will return detailed cookie 1934 * information in the `cookies` field. 1935 */ 1936 getCookies(): Promise<Protocol.Page.GetCookiesResponse>; 1937 1938 /** 1939 * Returns present frame tree structure. 1940 */ 1941 getFrameTree(): Promise<Protocol.Page.GetFrameTreeResponse>; 1942 1943 /** 1944 * Returns metrics relating to the layouting of the page, such as viewport bounds/scale. 1945 */ 1946 getLayoutMetrics(): Promise<Protocol.Page.GetLayoutMetricsResponse>; 1947 1948 /** 1949 * Returns navigation history for the current page. 1950 */ 1951 getNavigationHistory(): Promise<Protocol.Page.GetNavigationHistoryResponse>; 1952 1953 /** 1954 * Resets navigation history for the current page. 1955 */ 1956 resetNavigationHistory(): Promise<void>; 1957 1958 /** 1959 * Returns content of the given resource. 1960 */ 1961 getResourceContent(params: Protocol.Page.GetResourceContentRequest): 1962 Promise<Protocol.Page.GetResourceContentResponse>; 1963 1964 /** 1965 * Returns present frame / resource tree structure. 1966 */ 1967 getResourceTree(): Promise<Protocol.Page.GetResourceTreeResponse>; 1968 1969 /** 1970 * Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload). 1971 */ 1972 handleJavaScriptDialog(params: Protocol.Page.HandleJavaScriptDialogRequest): Promise<void>; 1973 1974 /** 1975 * Navigates current page to the given URL. 1976 */ 1977 navigate(params: Protocol.Page.NavigateRequest): Promise<Protocol.Page.NavigateResponse>; 1978 1979 /** 1980 * Navigates current page to the given history entry. 1981 */ 1982 navigateToHistoryEntry(params: Protocol.Page.NavigateToHistoryEntryRequest): Promise<void>; 1983 1984 /** 1985 * Print page as PDF. 1986 */ 1987 printToPDF(params: Protocol.Page.PrintToPDFRequest): Promise<Protocol.Page.PrintToPDFResponse>; 1988 1989 /** 1990 * Reloads given page optionally ignoring the cache. 1991 */ 1992 reload(params: Protocol.Page.ReloadRequest): Promise<void>; 1993 1994 /** 1995 * Deprecated, please use removeScriptToEvaluateOnNewDocument instead. 1996 */ 1997 removeScriptToEvaluateOnLoad(params: Protocol.Page.RemoveScriptToEvaluateOnLoadRequest): Promise<void>; 1998 1999 /** 2000 * Removes given script from the list. 2001 */ 2002 removeScriptToEvaluateOnNewDocument(params: Protocol.Page.RemoveScriptToEvaluateOnNewDocumentRequest): 2003 Promise<void>; 2004 2005 /** 2006 * Acknowledges that a screencast frame has been received by the frontend. 2007 */ 2008 screencastFrameAck(params: Protocol.Page.ScreencastFrameAckRequest): Promise<void>; 2009 2010 /** 2011 * Searches for given string in resource content. 2012 */ 2013 searchInResource(params: Protocol.Page.SearchInResourceRequest): Promise<Protocol.Page.SearchInResourceResponse>; 2014 2015 /** 2016 * Enable Chrome's experimental ad filter on all sites. 2017 */ 2018 setAdBlockingEnabled(params: Protocol.Page.SetAdBlockingEnabledRequest): Promise<void>; 2019 2020 /** 2021 * Enable page Content Security Policy by-passing. 2022 */ 2023 setBypassCSP(params: Protocol.Page.SetBypassCSPRequest): Promise<void>; 2024 2025 /** 2026 * Overrides the values of device screen dimensions (window.screen.width, window.screen.height, 2027 * window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media 2028 * query results). 2029 */ 2030 setDeviceMetricsOverride(params: Protocol.Page.SetDeviceMetricsOverrideRequest): Promise<void>; 2031 2032 /** 2033 * Overrides the Device Orientation. 2034 */ 2035 setDeviceOrientationOverride(params: Protocol.Page.SetDeviceOrientationOverrideRequest): Promise<void>; 2036 2037 /** 2038 * Set generic font families. 2039 */ 2040 setFontFamilies(params: Protocol.Page.SetFontFamiliesRequest): Promise<void>; 2041 2042 /** 2043 * Set default font sizes. 2044 */ 2045 setFontSizes(params: Protocol.Page.SetFontSizesRequest): Promise<void>; 2046 2047 /** 2048 * Sets given markup as the document's HTML. 2049 */ 2050 setDocumentContent(params: Protocol.Page.SetDocumentContentRequest): Promise<void>; 2051 2052 /** 2053 * Set the behavior when downloading a file. 2054 */ 2055 setDownloadBehavior(params: Protocol.Page.SetDownloadBehaviorRequest): Promise<void>; 2056 2057 /** 2058 * Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position 2059 * unavailable. 2060 */ 2061 setGeolocationOverride(params: Protocol.Page.SetGeolocationOverrideRequest): Promise<void>; 2062 2063 /** 2064 * Controls whether page will emit lifecycle events. 2065 */ 2066 setLifecycleEventsEnabled(params: Protocol.Page.SetLifecycleEventsEnabledRequest): Promise<void>; 2067 2068 /** 2069 * Toggles mouse event-based touch event emulation. 2070 */ 2071 setTouchEmulationEnabled(params: Protocol.Page.SetTouchEmulationEnabledRequest): Promise<void>; 2072 2073 /** 2074 * Starts sending each frame using the `screencastFrame` event. 2075 */ 2076 startScreencast(params: Protocol.Page.StartScreencastRequest): Promise<void>; 2077 2078 /** 2079 * Force the page stop all navigations and pending resource fetches. 2080 */ 2081 stopLoading(): Promise<void>; 2082 2083 /** 2084 * Crashes renderer on the IO thread, generates minidumps. 2085 */ 2086 crash(): Promise<void>; 2087 2088 /** 2089 * Tries to close page, running its beforeunload hooks, if any. 2090 */ 2091 close(): Promise<void>; 2092 2093 /** 2094 * Tries to update the web lifecycle state of the page. 2095 * It will transition the page to the given state according to: 2096 * https://github.com/WICG/web-lifecycle/ 2097 */ 2098 setWebLifecycleState(params: Protocol.Page.SetWebLifecycleStateRequest): Promise<void>; 2099 2100 /** 2101 * Stops sending each frame in the `screencastFrame`. 2102 */ 2103 stopScreencast(): Promise<void>; 2104 2105 /** 2106 * Forces compilation cache to be generated for every subresource script. 2107 */ 2108 setProduceCompilationCache(params: Protocol.Page.SetProduceCompilationCacheRequest): Promise<void>; 2109 2110 /** 2111 * Seeds compilation cache for given url. Compilation cache does not survive 2112 * cross-process navigation. 2113 */ 2114 addCompilationCache(params: Protocol.Page.AddCompilationCacheRequest): Promise<void>; 2115 2116 /** 2117 * Clears seeded compilation cache. 2118 */ 2119 clearCompilationCache(): Promise<void>; 2120 2121 /** 2122 * Generates a report for testing. 2123 */ 2124 generateTestReport(params: Protocol.Page.GenerateTestReportRequest): Promise<void>; 2125 2126 /** 2127 * Pauses page execution. Can be resumed using generic Runtime.runIfWaitingForDebugger. 2128 */ 2129 waitForDebugger(): Promise<void>; 2130 2131 /** 2132 * Intercept file chooser requests and transfer control to protocol clients. 2133 * When file chooser interception is enabled, native file chooser dialog is not shown. 2134 * Instead, a protocol event `Page.fileChooserOpened` is emitted. 2135 */ 2136 setInterceptFileChooserDialog(params: Protocol.Page.SetInterceptFileChooserDialogRequest): Promise<void>; 2137 2138 on(event: 'domContentEventFired', listener: (params: Protocol.Page.DomContentEventFiredEvent) => void): void; 2139 2140 /** 2141 * Emitted only when `page.interceptFileChooser` is enabled. 2142 */ 2143 on(event: 'fileChooserOpened', listener: (params: Protocol.Page.FileChooserOpenedEvent) => void): void; 2144 2145 /** 2146 * Fired when frame has been attached to its parent. 2147 */ 2148 on(event: 'frameAttached', listener: (params: Protocol.Page.FrameAttachedEvent) => void): void; 2149 2150 /** 2151 * Fired when frame no longer has a scheduled navigation. 2152 */ 2153 on(event: 'frameClearedScheduledNavigation', 2154 listener: (params: Protocol.Page.FrameClearedScheduledNavigationEvent) => void): void; 2155 2156 /** 2157 * Fired when frame has been detached from its parent. 2158 */ 2159 on(event: 'frameDetached', listener: (params: Protocol.Page.FrameDetachedEvent) => void): void; 2160 2161 /** 2162 * Fired once navigation of the frame has completed. Frame is now associated with the new loader. 2163 */ 2164 on(event: 'frameNavigated', listener: (params: Protocol.Page.FrameNavigatedEvent) => void): void; 2165 2166 on(event: 'frameResized', listener: () => void): void; 2167 2168 /** 2169 * Fired when a renderer-initiated navigation is requested. 2170 * Navigation may still be cancelled after the event is issued. 2171 */ 2172 on(event: 'frameRequestedNavigation', 2173 listener: (params: Protocol.Page.FrameRequestedNavigationEvent) => void): void; 2174 2175 /** 2176 * Fired when frame schedules a potential navigation. 2177 */ 2178 on(event: 'frameScheduledNavigation', 2179 listener: (params: Protocol.Page.FrameScheduledNavigationEvent) => void): void; 2180 2181 /** 2182 * Fired when frame has started loading. 2183 */ 2184 on(event: 'frameStartedLoading', listener: (params: Protocol.Page.FrameStartedLoadingEvent) => void): void; 2185 2186 /** 2187 * Fired when frame has stopped loading. 2188 */ 2189 on(event: 'frameStoppedLoading', listener: (params: Protocol.Page.FrameStoppedLoadingEvent) => void): void; 2190 2191 /** 2192 * Fired when page is about to start a download. 2193 */ 2194 on(event: 'downloadWillBegin', listener: (params: Protocol.Page.DownloadWillBeginEvent) => void): void; 2195 2196 /** 2197 * Fired when interstitial page was hidden 2198 */ 2199 on(event: 'interstitialHidden', listener: () => void): void; 2200 2201 /** 2202 * Fired when interstitial page was shown 2203 */ 2204 on(event: 'interstitialShown', listener: () => void): void; 2205 2206 /** 2207 * Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been 2208 * closed. 2209 */ 2210 on(event: 'javascriptDialogClosed', listener: (params: Protocol.Page.JavascriptDialogClosedEvent) => void): void; 2211 2212 /** 2213 * Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to 2214 * open. 2215 */ 2216 on(event: 'javascriptDialogOpening', listener: (params: Protocol.Page.JavascriptDialogOpeningEvent) => void): void; 2217 2218 /** 2219 * Fired for top level page lifecycle events such as navigation, load, paint, etc. 2220 */ 2221 on(event: 'lifecycleEvent', listener: (params: Protocol.Page.LifecycleEventEvent) => void): void; 2222 2223 on(event: 'loadEventFired', listener: (params: Protocol.Page.LoadEventFiredEvent) => void): void; 2224 2225 /** 2226 * Fired when same-document navigation happens, e.g. due to history API usage or anchor navigation. 2227 */ 2228 on(event: 'navigatedWithinDocument', listener: (params: Protocol.Page.NavigatedWithinDocumentEvent) => void): void; 2229 2230 /** 2231 * Compressed image data requested by the `startScreencast`. 2232 */ 2233 on(event: 'screencastFrame', listener: (params: Protocol.Page.ScreencastFrameEvent) => void): void; 2234 2235 /** 2236 * Fired when the page with currently enabled screencast was shown or hidden `. 2237 */ 2238 on(event: 'screencastVisibilityChanged', 2239 listener: (params: Protocol.Page.ScreencastVisibilityChangedEvent) => void): void; 2240 2241 /** 2242 * Fired when a new window is going to be opened, via window.open(), link click, form submission, 2243 * etc. 2244 */ 2245 on(event: 'windowOpen', listener: (params: Protocol.Page.WindowOpenEvent) => void): void; 2246 2247 /** 2248 * Issued for every compilation cache generated. Is only available 2249 * if Page.setGenerateCompilationCache is enabled. 2250 */ 2251 on(event: 'compilationCacheProduced', 2252 listener: (params: Protocol.Page.CompilationCacheProducedEvent) => void): void; 2253 } 2254 2255 export interface PerformanceApi { 2256 /** 2257 * Disable collecting and reporting metrics. 2258 */ 2259 disable(): Promise<void>; 2260 2261 /** 2262 * Enable collecting and reporting metrics. 2263 */ 2264 enable(params: Protocol.Performance.EnableRequest): Promise<void>; 2265 2266 /** 2267 * Sets time domain to use for collecting and reporting duration metrics. 2268 * Note that this must be called before enabling metrics collection. Calling 2269 * this method while metrics collection is enabled returns an error. 2270 */ 2271 setTimeDomain(params: Protocol.Performance.SetTimeDomainRequest): Promise<void>; 2272 2273 /** 2274 * Retrieve current values of run-time metrics. 2275 */ 2276 getMetrics(): Promise<Protocol.Performance.GetMetricsResponse>; 2277 2278 /** 2279 * Current values of the metrics. 2280 */ 2281 on(event: 'metrics', listener: (params: Protocol.Performance.MetricsEvent) => void): void; 2282 } 2283 2284 export interface SecurityApi { 2285 /** 2286 * Disables tracking security state changes. 2287 */ 2288 disable(): Promise<void>; 2289 2290 /** 2291 * Enables tracking security state changes. 2292 */ 2293 enable(): Promise<void>; 2294 2295 /** 2296 * Enable/disable whether all certificate errors should be ignored. 2297 */ 2298 setIgnoreCertificateErrors(params: Protocol.Security.SetIgnoreCertificateErrorsRequest): Promise<void>; 2299 2300 /** 2301 * Handles a certificate error that fired a certificateError event. 2302 */ 2303 handleCertificateError(params: Protocol.Security.HandleCertificateErrorRequest): Promise<void>; 2304 2305 /** 2306 * Enable/disable overriding certificate errors. If enabled, all certificate error events need to 2307 * be handled by the DevTools client and should be answered with `handleCertificateError` commands. 2308 */ 2309 setOverrideCertificateErrors(params: Protocol.Security.SetOverrideCertificateErrorsRequest): Promise<void>; 2310 2311 /** 2312 * There is a certificate error. If overriding certificate errors is enabled, then it should be 2313 * handled with the `handleCertificateError` command. Note: this event does not fire if the 2314 * certificate error has been allowed internally. Only one client per target should override 2315 * certificate errors at the same time. 2316 */ 2317 on(event: 'certificateError', listener: (params: Protocol.Security.CertificateErrorEvent) => void): void; 2318 2319 /** 2320 * The security state of the page changed. 2321 */ 2322 on(event: 'visibleSecurityStateChanged', 2323 listener: (params: Protocol.Security.VisibleSecurityStateChangedEvent) => void): void; 2324 2325 /** 2326 * The security state of the page changed. 2327 */ 2328 on(event: 'securityStateChanged', listener: (params: Protocol.Security.SecurityStateChangedEvent) => void): void; 2329 } 2330 2331 export interface ServiceWorkerApi { 2332 deliverPushMessage(params: Protocol.ServiceWorker.DeliverPushMessageRequest): Promise<void>; 2333 2334 disable(): Promise<void>; 2335 2336 dispatchSyncEvent(params: Protocol.ServiceWorker.DispatchSyncEventRequest): Promise<void>; 2337 2338 dispatchPeriodicSyncEvent(params: Protocol.ServiceWorker.DispatchPeriodicSyncEventRequest): Promise<void>; 2339 2340 enable(): Promise<void>; 2341 2342 inspectWorker(params: Protocol.ServiceWorker.InspectWorkerRequest): Promise<void>; 2343 2344 setForceUpdateOnPageLoad(params: Protocol.ServiceWorker.SetForceUpdateOnPageLoadRequest): Promise<void>; 2345 2346 skipWaiting(params: Protocol.ServiceWorker.SkipWaitingRequest): Promise<void>; 2347 2348 startWorker(params: Protocol.ServiceWorker.StartWorkerRequest): Promise<void>; 2349 2350 stopAllWorkers(): Promise<void>; 2351 2352 stopWorker(params: Protocol.ServiceWorker.StopWorkerRequest): Promise<void>; 2353 2354 unregister(params: Protocol.ServiceWorker.UnregisterRequest): Promise<void>; 2355 2356 updateRegistration(params: Protocol.ServiceWorker.UpdateRegistrationRequest): Promise<void>; 2357 2358 on(event: 'workerErrorReported', listener: (params: Protocol.ServiceWorker.WorkerErrorReportedEvent) => void): void; 2359 2360 on(event: 'workerRegistrationUpdated', 2361 listener: (params: Protocol.ServiceWorker.WorkerRegistrationUpdatedEvent) => void): void; 2362 2363 on(event: 'workerVersionUpdated', 2364 listener: (params: Protocol.ServiceWorker.WorkerVersionUpdatedEvent) => void): void; 2365 } 2366 2367 export interface StorageApi { 2368 /** 2369 * Clears storage for origin. 2370 */ 2371 clearDataForOrigin(params: Protocol.Storage.ClearDataForOriginRequest): Promise<void>; 2372 2373 /** 2374 * Returns all browser cookies. 2375 */ 2376 getCookies(params: Protocol.Storage.GetCookiesRequest): Promise<Protocol.Storage.GetCookiesResponse>; 2377 2378 /** 2379 * Sets given cookies. 2380 */ 2381 setCookies(params: Protocol.Storage.SetCookiesRequest): Promise<void>; 2382 2383 /** 2384 * Clears cookies. 2385 */ 2386 clearCookies(params: Protocol.Storage.ClearCookiesRequest): Promise<void>; 2387 2388 /** 2389 * Returns usage and quota in bytes. 2390 */ 2391 getUsageAndQuota(params: Protocol.Storage.GetUsageAndQuotaRequest): 2392 Promise<Protocol.Storage.GetUsageAndQuotaResponse>; 2393 2394 /** 2395 * Registers origin to be notified when an update occurs to its cache storage list. 2396 */ 2397 trackCacheStorageForOrigin(params: Protocol.Storage.TrackCacheStorageForOriginRequest): Promise<void>; 2398 2399 /** 2400 * Registers origin to be notified when an update occurs to its IndexedDB. 2401 */ 2402 trackIndexedDBForOrigin(params: Protocol.Storage.TrackIndexedDBForOriginRequest): Promise<void>; 2403 2404 /** 2405 * Unregisters origin from receiving notifications for cache storage. 2406 */ 2407 untrackCacheStorageForOrigin(params: Protocol.Storage.UntrackCacheStorageForOriginRequest): Promise<void>; 2408 2409 /** 2410 * Unregisters origin from receiving notifications for IndexedDB. 2411 */ 2412 untrackIndexedDBForOrigin(params: Protocol.Storage.UntrackIndexedDBForOriginRequest): Promise<void>; 2413 2414 /** 2415 * A cache's contents have been modified. 2416 */ 2417 on(event: 'cacheStorageContentUpdated', 2418 listener: (params: Protocol.Storage.CacheStorageContentUpdatedEvent) => void): void; 2419 2420 /** 2421 * A cache has been added/deleted. 2422 */ 2423 on(event: 'cacheStorageListUpdated', 2424 listener: (params: Protocol.Storage.CacheStorageListUpdatedEvent) => void): void; 2425 2426 /** 2427 * The origin's IndexedDB object store has been modified. 2428 */ 2429 on(event: 'indexedDBContentUpdated', 2430 listener: (params: Protocol.Storage.IndexedDBContentUpdatedEvent) => void): void; 2431 2432 /** 2433 * The origin's IndexedDB database list has been modified. 2434 */ 2435 on(event: 'indexedDBListUpdated', listener: (params: Protocol.Storage.IndexedDBListUpdatedEvent) => void): void; 2436 } 2437 2438 export interface SystemInfoApi { 2439 /** 2440 * Returns information about the system. 2441 */ 2442 getInfo(): Promise<Protocol.SystemInfo.GetInfoResponse>; 2443 2444 /** 2445 * Returns information about all running processes. 2446 */ 2447 getProcessInfo(): Promise<Protocol.SystemInfo.GetProcessInfoResponse>; 2448 } 2449 2450 export interface TargetApi { 2451 /** 2452 * Activates (focuses) the target. 2453 */ 2454 activateTarget(params: Protocol.Target.ActivateTargetRequest): Promise<void>; 2455 2456 /** 2457 * Attaches to the target with given id. 2458 */ 2459 attachToTarget(params: Protocol.Target.AttachToTargetRequest): Promise<Protocol.Target.AttachToTargetResponse>; 2460 2461 /** 2462 * Attaches to the browser target, only uses flat sessionId mode. 2463 */ 2464 attachToBrowserTarget(): Promise<Protocol.Target.AttachToBrowserTargetResponse>; 2465 2466 /** 2467 * Closes the target. If the target is a page that gets closed too. 2468 */ 2469 closeTarget(params: Protocol.Target.CloseTargetRequest): Promise<Protocol.Target.CloseTargetResponse>; 2470 2471 /** 2472 * Inject object to the target's main frame that provides a communication 2473 * channel with browser target. 2474 * 2475 * Injected object will be available as `window[bindingName]`. 2476 * 2477 * The object has the follwing API: 2478 * - `binding.send(json)` - a method to send messages over the remote debugging protocol 2479 * - `binding.onmessage = json => handleMessage(json)` - a callback that will be called for the protocol notifications and command responses. 2480 */ 2481 exposeDevToolsProtocol(params: Protocol.Target.ExposeDevToolsProtocolRequest): Promise<void>; 2482 2483 /** 2484 * Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than 2485 * one. 2486 */ 2487 createBrowserContext(params: Protocol.Target.CreateBrowserContextRequest): 2488 Promise<Protocol.Target.CreateBrowserContextResponse>; 2489 2490 /** 2491 * Returns all browser contexts created with `Target.createBrowserContext` method. 2492 */ 2493 getBrowserContexts(): Promise<Protocol.Target.GetBrowserContextsResponse>; 2494 2495 /** 2496 * Creates a new page. 2497 */ 2498 createTarget(params: Protocol.Target.CreateTargetRequest): Promise<Protocol.Target.CreateTargetResponse>; 2499 2500 /** 2501 * Detaches session with given id. 2502 */ 2503 detachFromTarget(params: Protocol.Target.DetachFromTargetRequest): Promise<void>; 2504 2505 /** 2506 * Deletes a BrowserContext. All the belonging pages will be closed without calling their 2507 * beforeunload hooks. 2508 */ 2509 disposeBrowserContext(params: Protocol.Target.DisposeBrowserContextRequest): Promise<void>; 2510 2511 /** 2512 * Returns information about a target. 2513 */ 2514 getTargetInfo(params: Protocol.Target.GetTargetInfoRequest): Promise<Protocol.Target.GetTargetInfoResponse>; 2515 2516 /** 2517 * Retrieves a list of available targets. 2518 */ 2519 getTargets(): Promise<Protocol.Target.GetTargetsResponse>; 2520 2521 /** 2522 * Sends protocol message over session with given id. 2523 * Consider using flat mode instead; see commands attachToTarget, setAutoAttach, 2524 * and crbug.com/991325. 2525 */ 2526 sendMessageToTarget(params: Protocol.Target.SendMessageToTargetRequest): Promise<void>; 2527 2528 /** 2529 * Controls whether to automatically attach to new targets which are considered to be related to 2530 * this one. When turned on, attaches to all existing related targets as well. When turned off, 2531 * automatically detaches from all currently attached targets. 2532 */ 2533 setAutoAttach(params: Protocol.Target.SetAutoAttachRequest): Promise<void>; 2534 2535 /** 2536 * Controls whether to discover available targets and notify via 2537 * `targetCreated/targetInfoChanged/targetDestroyed` events. 2538 */ 2539 setDiscoverTargets(params: Protocol.Target.SetDiscoverTargetsRequest): Promise<void>; 2540 2541 /** 2542 * Enables target discovery for the specified locations, when `setDiscoverTargets` was set to 2543 * `true`. 2544 */ 2545 setRemoteLocations(params: Protocol.Target.SetRemoteLocationsRequest): Promise<void>; 2546 2547 /** 2548 * Issued when attached to target because of auto-attach or `attachToTarget` command. 2549 */ 2550 on(event: 'attachedToTarget', listener: (params: Protocol.Target.AttachedToTargetEvent) => void): void; 2551 2552 /** 2553 * Issued when detached from target for any reason (including `detachFromTarget` command). Can be 2554 * issued multiple times per target if multiple sessions have been attached to it. 2555 */ 2556 on(event: 'detachedFromTarget', listener: (params: Protocol.Target.DetachedFromTargetEvent) => void): void; 2557 2558 /** 2559 * Notifies about a new protocol message received from the session (as reported in 2560 * `attachedToTarget` event). 2561 */ 2562 on(event: 'receivedMessageFromTarget', 2563 listener: (params: Protocol.Target.ReceivedMessageFromTargetEvent) => void): void; 2564 2565 /** 2566 * Issued when a possible inspection target is created. 2567 */ 2568 on(event: 'targetCreated', listener: (params: Protocol.Target.TargetCreatedEvent) => void): void; 2569 2570 /** 2571 * Issued when a target is destroyed. 2572 */ 2573 on(event: 'targetDestroyed', listener: (params: Protocol.Target.TargetDestroyedEvent) => void): void; 2574 2575 /** 2576 * Issued when a target has crashed. 2577 */ 2578 on(event: 'targetCrashed', listener: (params: Protocol.Target.TargetCrashedEvent) => void): void; 2579 2580 /** 2581 * Issued when some information about a target has changed. This only happens between 2582 * `targetCreated` and `targetDestroyed`. 2583 */ 2584 on(event: 'targetInfoChanged', listener: (params: Protocol.Target.TargetInfoChangedEvent) => void): void; 2585 } 2586 2587 export interface TetheringApi { 2588 /** 2589 * Request browser port binding. 2590 */ 2591 bind(params: Protocol.Tethering.BindRequest): Promise<void>; 2592 2593 /** 2594 * Request browser port unbinding. 2595 */ 2596 unbind(params: Protocol.Tethering.UnbindRequest): Promise<void>; 2597 2598 /** 2599 * Informs that port was successfully bound and got a specified connection id. 2600 */ 2601 on(event: 'accepted', listener: (params: Protocol.Tethering.AcceptedEvent) => void): void; 2602 } 2603 2604 export interface TracingApi { 2605 /** 2606 * Stop trace events collection. 2607 */ 2608 end(): Promise<void>; 2609 2610 /** 2611 * Gets supported tracing categories. 2612 */ 2613 getCategories(): Promise<Protocol.Tracing.GetCategoriesResponse>; 2614 2615 /** 2616 * Record a clock sync marker in the trace. 2617 */ 2618 recordClockSyncMarker(params: Protocol.Tracing.RecordClockSyncMarkerRequest): Promise<void>; 2619 2620 /** 2621 * Request a global memory dump. 2622 */ 2623 requestMemoryDump(params: Protocol.Tracing.RequestMemoryDumpRequest): 2624 Promise<Protocol.Tracing.RequestMemoryDumpResponse>; 2625 2626 /** 2627 * Start trace events collection. 2628 */ 2629 start(params: Protocol.Tracing.StartRequest): Promise<void>; 2630 2631 on(event: 'bufferUsage', listener: (params: Protocol.Tracing.BufferUsageEvent) => void): void; 2632 2633 /** 2634 * Contains an bucket of collected trace events. When tracing is stopped collected events will be 2635 * send as a sequence of dataCollected events followed by tracingComplete event. 2636 */ 2637 on(event: 'dataCollected', listener: (params: Protocol.Tracing.DataCollectedEvent) => void): void; 2638 2639 /** 2640 * Signals that tracing is stopped and there is no trace buffers pending flush, all data were 2641 * delivered via dataCollected events. 2642 */ 2643 on(event: 'tracingComplete', listener: (params: Protocol.Tracing.TracingCompleteEvent) => void): void; 2644 } 2645 2646 export interface FetchApi { 2647 /** 2648 * Disables the fetch domain. 2649 */ 2650 disable(): Promise<void>; 2651 2652 /** 2653 * Enables issuing of requestPaused events. A request will be paused until client 2654 * calls one of failRequest, fulfillRequest or continueRequest/continueWithAuth. 2655 */ 2656 enable(params: Protocol.Fetch.EnableRequest): Promise<void>; 2657 2658 /** 2659 * Causes the request to fail with specified reason. 2660 */ 2661 failRequest(params: Protocol.Fetch.FailRequestRequest): Promise<void>; 2662 2663 /** 2664 * Provides response to the request. 2665 */ 2666 fulfillRequest(params: Protocol.Fetch.FulfillRequestRequest): Promise<void>; 2667 2668 /** 2669 * Continues the request, optionally modifying some of its parameters. 2670 */ 2671 continueRequest(params: Protocol.Fetch.ContinueRequestRequest): Promise<void>; 2672 2673 /** 2674 * Continues a request supplying authChallengeResponse following authRequired event. 2675 */ 2676 continueWithAuth(params: Protocol.Fetch.ContinueWithAuthRequest): Promise<void>; 2677 2678 /** 2679 * Causes the body of the response to be received from the server and 2680 * returned as a single string. May only be issued for a request that 2681 * is paused in the Response stage and is mutually exclusive with 2682 * takeResponseBodyForInterceptionAsStream. Calling other methods that 2683 * affect the request or disabling fetch domain before body is received 2684 * results in an undefined behavior. 2685 */ 2686 getResponseBody(params: Protocol.Fetch.GetResponseBodyRequest): Promise<Protocol.Fetch.GetResponseBodyResponse>; 2687 2688 /** 2689 * Returns a handle to the stream representing the response body. 2690 * The request must be paused in the HeadersReceived stage. 2691 * Note that after this command the request can't be continued 2692 * as is -- client either needs to cancel it or to provide the 2693 * response body. 2694 * The stream only supports sequential read, IO.read will fail if the position 2695 * is specified. 2696 * This method is mutually exclusive with getResponseBody. 2697 * Calling other methods that affect the request or disabling fetch 2698 * domain before body is received results in an undefined behavior. 2699 */ 2700 takeResponseBodyAsStream(params: Protocol.Fetch.TakeResponseBodyAsStreamRequest): 2701 Promise<Protocol.Fetch.TakeResponseBodyAsStreamResponse>; 2702 2703 /** 2704 * Issued when the domain is enabled and the request URL matches the 2705 * specified filter. The request is paused until the client responds 2706 * with one of continueRequest, failRequest or fulfillRequest. 2707 * The stage of the request can be determined by presence of responseErrorReason 2708 * and responseStatusCode -- the request is at the response stage if either 2709 * of these fields is present and in the request stage otherwise. 2710 */ 2711 on(event: 'requestPaused', listener: (params: Protocol.Fetch.RequestPausedEvent) => void): void; 2712 2713 /** 2714 * Issued when the domain is enabled with handleAuthRequests set to true. 2715 * The request is paused until client responds with continueWithAuth. 2716 */ 2717 on(event: 'authRequired', listener: (params: Protocol.Fetch.AuthRequiredEvent) => void): void; 2718 } 2719 2720 export interface WebAudioApi { 2721 /** 2722 * Enables the WebAudio domain and starts sending context lifetime events. 2723 */ 2724 enable(): Promise<void>; 2725 2726 /** 2727 * Disables the WebAudio domain. 2728 */ 2729 disable(): Promise<void>; 2730 2731 /** 2732 * Fetch the realtime data from the registered contexts. 2733 */ 2734 getRealtimeData(params: Protocol.WebAudio.GetRealtimeDataRequest): 2735 Promise<Protocol.WebAudio.GetRealtimeDataResponse>; 2736 2737 /** 2738 * Notifies that a new BaseAudioContext has been created. 2739 */ 2740 on(event: 'contextCreated', listener: (params: Protocol.WebAudio.ContextCreatedEvent) => void): void; 2741 2742 /** 2743 * Notifies that an existing BaseAudioContext will be destroyed. 2744 */ 2745 on(event: 'contextWillBeDestroyed', 2746 listener: (params: Protocol.WebAudio.ContextWillBeDestroyedEvent) => void): void; 2747 2748 /** 2749 * Notifies that existing BaseAudioContext has changed some properties (id stays the same).. 2750 */ 2751 on(event: 'contextChanged', listener: (params: Protocol.WebAudio.ContextChangedEvent) => void): void; 2752 2753 /** 2754 * Notifies that the construction of an AudioListener has finished. 2755 */ 2756 on(event: 'audioListenerCreated', listener: (params: Protocol.WebAudio.AudioListenerCreatedEvent) => void): void; 2757 2758 /** 2759 * Notifies that a new AudioListener has been created. 2760 */ 2761 on(event: 'audioListenerWillBeDestroyed', 2762 listener: (params: Protocol.WebAudio.AudioListenerWillBeDestroyedEvent) => void): void; 2763 2764 /** 2765 * Notifies that a new AudioNode has been created. 2766 */ 2767 on(event: 'audioNodeCreated', listener: (params: Protocol.WebAudio.AudioNodeCreatedEvent) => void): void; 2768 2769 /** 2770 * Notifies that an existing AudioNode has been destroyed. 2771 */ 2772 on(event: 'audioNodeWillBeDestroyed', 2773 listener: (params: Protocol.WebAudio.AudioNodeWillBeDestroyedEvent) => void): void; 2774 2775 /** 2776 * Notifies that a new AudioParam has been created. 2777 */ 2778 on(event: 'audioParamCreated', listener: (params: Protocol.WebAudio.AudioParamCreatedEvent) => void): void; 2779 2780 /** 2781 * Notifies that an existing AudioParam has been destroyed. 2782 */ 2783 on(event: 'audioParamWillBeDestroyed', 2784 listener: (params: Protocol.WebAudio.AudioParamWillBeDestroyedEvent) => void): void; 2785 2786 /** 2787 * Notifies that two AudioNodes are connected. 2788 */ 2789 on(event: 'nodesConnected', listener: (params: Protocol.WebAudio.NodesConnectedEvent) => void): void; 2790 2791 /** 2792 * Notifies that AudioNodes are disconnected. The destination can be null, and it means all the outgoing connections from the source are disconnected. 2793 */ 2794 on(event: 'nodesDisconnected', listener: (params: Protocol.WebAudio.NodesDisconnectedEvent) => void): void; 2795 2796 /** 2797 * Notifies that an AudioNode is connected to an AudioParam. 2798 */ 2799 on(event: 'nodeParamConnected', listener: (params: Protocol.WebAudio.NodeParamConnectedEvent) => void): void; 2800 2801 /** 2802 * Notifies that an AudioNode is disconnected to an AudioParam. 2803 */ 2804 on(event: 'nodeParamDisconnected', listener: (params: Protocol.WebAudio.NodeParamDisconnectedEvent) => void): void; 2805 } 2806 2807 export interface WebAuthnApi { 2808 /** 2809 * Enable the WebAuthn domain and start intercepting credential storage and 2810 * retrieval with a virtual authenticator. 2811 */ 2812 enable(): Promise<void>; 2813 2814 /** 2815 * Disable the WebAuthn domain. 2816 */ 2817 disable(): Promise<void>; 2818 2819 /** 2820 * Creates and adds a virtual authenticator. 2821 */ 2822 addVirtualAuthenticator(params: Protocol.WebAuthn.AddVirtualAuthenticatorRequest): 2823 Promise<Protocol.WebAuthn.AddVirtualAuthenticatorResponse>; 2824 2825 /** 2826 * Removes the given authenticator. 2827 */ 2828 removeVirtualAuthenticator(params: Protocol.WebAuthn.RemoveVirtualAuthenticatorRequest): Promise<void>; 2829 2830 /** 2831 * Adds the credential to the specified authenticator. 2832 */ 2833 addCredential(params: Protocol.WebAuthn.AddCredentialRequest): Promise<void>; 2834 2835 /** 2836 * Returns a single credential stored in the given virtual authenticator that 2837 * matches the credential ID. 2838 */ 2839 getCredential(params: Protocol.WebAuthn.GetCredentialRequest): Promise<Protocol.WebAuthn.GetCredentialResponse>; 2840 2841 /** 2842 * Returns all the credentials stored in the given virtual authenticator. 2843 */ 2844 getCredentials(params: Protocol.WebAuthn.GetCredentialsRequest): Promise<Protocol.WebAuthn.GetCredentialsResponse>; 2845 2846 /** 2847 * Removes a credential from the authenticator. 2848 */ 2849 removeCredential(params: Protocol.WebAuthn.RemoveCredentialRequest): Promise<void>; 2850 2851 /** 2852 * Clears all the credentials from the specified device. 2853 */ 2854 clearCredentials(params: Protocol.WebAuthn.ClearCredentialsRequest): Promise<void>; 2855 2856 /** 2857 * Sets whether User Verification succeeds or fails for an authenticator. 2858 * The default is true. 2859 */ 2860 setUserVerified(params: Protocol.WebAuthn.SetUserVerifiedRequest): Promise<void>; 2861 } 2862 2863 export interface MediaApi { 2864 /** 2865 * Enables the Media domain 2866 */ 2867 enable(): Promise<void>; 2868 2869 /** 2870 * Disables the Media domain. 2871 */ 2872 disable(): Promise<void>; 2873 2874 /** 2875 * This can be called multiple times, and can be used to set / override / 2876 * remove player properties. A null propValue indicates removal. 2877 */ 2878 on(event: 'playerPropertiesChanged', listener: (params: Protocol.Media.PlayerPropertiesChangedEvent) => void): void; 2879 2880 /** 2881 * Send events as a list, allowing them to be batched on the browser for less 2882 * congestion. If batched, events must ALWAYS be in chronological order. 2883 */ 2884 on(event: 'playerEventsAdded', listener: (params: Protocol.Media.PlayerEventsAddedEvent) => void): void; 2885 2886 /** 2887 * Called whenever a player is created, or when a new agent joins and recieves 2888 * a list of active players. If an agent is restored, it will recieve the full 2889 * list of player ids and all events again. 2890 */ 2891 on(event: 'playersCreated', listener: (params: Protocol.Media.PlayersCreatedEvent) => void): void; 2892 } 2893 2894 export interface ConsoleApi { 2895 /** 2896 * Does nothing. 2897 */ 2898 clearMessages(): Promise<void>; 2899 2900 /** 2901 * Disables console domain, prevents further console messages from being reported to the client. 2902 */ 2903 disable(): Promise<void>; 2904 2905 /** 2906 * Enables console domain, sends the messages collected so far to the client by means of the 2907 * `messageAdded` notification. 2908 */ 2909 enable(): Promise<void>; 2910 2911 /** 2912 * Issued when new console message is added. 2913 */ 2914 on(event: 'messageAdded', listener: (params: Protocol.Console.MessageAddedEvent) => void): void; 2915 } 2916 2917 export interface DebuggerApi { 2918 /** 2919 * Continues execution until specific location is reached. 2920 */ 2921 continueToLocation(params: Protocol.Debugger.ContinueToLocationRequest): Promise<void>; 2922 2923 /** 2924 * Disables debugger for given page. 2925 */ 2926 disable(): Promise<void>; 2927 2928 /** 2929 * Enables debugger for the given page. Clients should not assume that the debugging has been 2930 * enabled until the result for this command is received. 2931 */ 2932 enable(params: Protocol.Debugger.EnableRequest): Promise<Protocol.Debugger.EnableResponse>; 2933 2934 /** 2935 * Evaluates expression on a given call frame. 2936 */ 2937 evaluateOnCallFrame(params: Protocol.Debugger.EvaluateOnCallFrameRequest): 2938 Promise<Protocol.Debugger.EvaluateOnCallFrameResponse>; 2939 2940 /** 2941 * Returns possible locations for breakpoint. scriptId in start and end range locations should be 2942 * the same. 2943 */ 2944 getPossibleBreakpoints(params: Protocol.Debugger.GetPossibleBreakpointsRequest): 2945 Promise<Protocol.Debugger.GetPossibleBreakpointsResponse>; 2946 2947 /** 2948 * Returns source for the script with given id. 2949 */ 2950 getScriptSource(params: Protocol.Debugger.GetScriptSourceRequest): 2951 Promise<Protocol.Debugger.GetScriptSourceResponse>; 2952 2953 /** 2954 * This command is deprecated. Use getScriptSource instead. 2955 */ 2956 getWasmBytecode(params: Protocol.Debugger.GetWasmBytecodeRequest): 2957 Promise<Protocol.Debugger.GetWasmBytecodeResponse>; 2958 2959 /** 2960 * Returns stack trace with given `stackTraceId`. 2961 */ 2962 getStackTrace(params: Protocol.Debugger.GetStackTraceRequest): Promise<Protocol.Debugger.GetStackTraceResponse>; 2963 2964 /** 2965 * Stops on the next JavaScript statement. 2966 */ 2967 pause(): Promise<void>; 2968 2969 pauseOnAsyncCall(params: Protocol.Debugger.PauseOnAsyncCallRequest): Promise<void>; 2970 2971 /** 2972 * Removes JavaScript breakpoint. 2973 */ 2974 removeBreakpoint(params: Protocol.Debugger.RemoveBreakpointRequest): Promise<void>; 2975 2976 /** 2977 * Restarts particular call frame from the beginning. 2978 */ 2979 restartFrame(params: Protocol.Debugger.RestartFrameRequest): Promise<Protocol.Debugger.RestartFrameResponse>; 2980 2981 /** 2982 * Resumes JavaScript execution. 2983 */ 2984 resume(params: Protocol.Debugger.ResumeRequest): Promise<void>; 2985 2986 /** 2987 * Searches for given string in script content. 2988 */ 2989 searchInContent(params: Protocol.Debugger.SearchInContentRequest): 2990 Promise<Protocol.Debugger.SearchInContentResponse>; 2991 2992 /** 2993 * Enables or disables async call stacks tracking. 2994 */ 2995 setAsyncCallStackDepth(params: Protocol.Debugger.SetAsyncCallStackDepthRequest): Promise<void>; 2996 2997 /** 2998 * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in 2999 * scripts with url matching one of the patterns. VM will try to leave blackboxed script by 3000 * performing 'step in' several times, finally resorting to 'step out' if unsuccessful. 3001 */ 3002 setBlackboxPatterns(params: Protocol.Debugger.SetBlackboxPatternsRequest): Promise<void>; 3003 3004 /** 3005 * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted 3006 * scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. 3007 * Positions array contains positions where blackbox state is changed. First interval isn't 3008 * blackboxed. Array should be sorted. 3009 */ 3010 setBlackboxedRanges(params: Protocol.Debugger.SetBlackboxedRangesRequest): Promise<void>; 3011 3012 /** 3013 * Sets JavaScript breakpoint at a given location. 3014 */ 3015 setBreakpoint(params: Protocol.Debugger.SetBreakpointRequest): Promise<Protocol.Debugger.SetBreakpointResponse>; 3016 3017 /** 3018 * Sets instrumentation breakpoint. 3019 */ 3020 setInstrumentationBreakpoint(params: Protocol.Debugger.SetInstrumentationBreakpointRequest): 3021 Promise<Protocol.Debugger.SetInstrumentationBreakpointResponse>; 3022 3023 /** 3024 * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this 3025 * command is issued, all existing parsed scripts will have breakpoints resolved and returned in 3026 * `locations` property. Further matching script parsing will result in subsequent 3027 * `breakpointResolved` events issued. This logical breakpoint will survive page reloads. 3028 */ 3029 setBreakpointByUrl(params: Protocol.Debugger.SetBreakpointByUrlRequest): 3030 Promise<Protocol.Debugger.SetBreakpointByUrlResponse>; 3031 3032 /** 3033 * Sets JavaScript breakpoint before each call to the given function. 3034 * If another function was created from the same source as a given one, 3035 * calling it will also trigger the breakpoint. 3036 */ 3037 setBreakpointOnFunctionCall(params: Protocol.Debugger.SetBreakpointOnFunctionCallRequest): 3038 Promise<Protocol.Debugger.SetBreakpointOnFunctionCallResponse>; 3039 3040 /** 3041 * Activates / deactivates all breakpoints on the page. 3042 */ 3043 setBreakpointsActive(params: Protocol.Debugger.SetBreakpointsActiveRequest): Promise<void>; 3044 3045 /** 3046 * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or 3047 * no exceptions. Initial pause on exceptions state is `none`. 3048 */ 3049 setPauseOnExceptions(params: Protocol.Debugger.SetPauseOnExceptionsRequest): Promise<void>; 3050 3051 /** 3052 * Changes return value in top frame. Available only at return break position. 3053 */ 3054 setReturnValue(params: Protocol.Debugger.SetReturnValueRequest): Promise<void>; 3055 3056 /** 3057 * Edits JavaScript source live. 3058 */ 3059 setScriptSource(params: Protocol.Debugger.SetScriptSourceRequest): 3060 Promise<Protocol.Debugger.SetScriptSourceResponse>; 3061 3062 /** 3063 * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). 3064 */ 3065 setSkipAllPauses(params: Protocol.Debugger.SetSkipAllPausesRequest): Promise<void>; 3066 3067 /** 3068 * Changes value of variable in a callframe. Object-based scopes are not supported and must be 3069 * mutated manually. 3070 */ 3071 setVariableValue(params: Protocol.Debugger.SetVariableValueRequest): Promise<void>; 3072 3073 /** 3074 * Steps into the function call. 3075 */ 3076 stepInto(params: Protocol.Debugger.StepIntoRequest): Promise<void>; 3077 3078 /** 3079 * Steps out of the function call. 3080 */ 3081 stepOut(): Promise<void>; 3082 3083 /** 3084 * Steps over the statement. 3085 */ 3086 stepOver(): Promise<void>; 3087 3088 /** 3089 * Fired when breakpoint is resolved to an actual script and location. 3090 */ 3091 on(event: 'breakpointResolved', listener: (params: Protocol.Debugger.BreakpointResolvedEvent) => void): void; 3092 3093 /** 3094 * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. 3095 */ 3096 on(event: 'paused', listener: (params: Protocol.Debugger.PausedEvent) => void): void; 3097 3098 /** 3099 * Fired when the virtual machine resumed execution. 3100 */ 3101 on(event: 'resumed', listener: () => void): void; 3102 3103 /** 3104 * Fired when virtual machine fails to parse the script. 3105 */ 3106 on(event: 'scriptFailedToParse', listener: (params: Protocol.Debugger.ScriptFailedToParseEvent) => void): void; 3107 3108 /** 3109 * Fired when virtual machine parses script. This event is also fired for all known and uncollected 3110 * scripts upon enabling debugger. 3111 */ 3112 on(event: 'scriptParsed', listener: (params: Protocol.Debugger.ScriptParsedEvent) => void): void; 3113 } 3114 3115 export interface HeapProfilerApi { 3116 /** 3117 * Enables console to refer to the node with given id via $x (see Command Line API for more details 3118 * $x functions). 3119 */ 3120 addInspectedHeapObject(params: Protocol.HeapProfiler.AddInspectedHeapObjectRequest): Promise<void>; 3121 3122 collectGarbage(): Promise<void>; 3123 3124 disable(): Promise<void>; 3125 3126 enable(): Promise<void>; 3127 3128 getHeapObjectId(params: Protocol.HeapProfiler.GetHeapObjectIdRequest): 3129 Promise<Protocol.HeapProfiler.GetHeapObjectIdResponse>; 3130 3131 getObjectByHeapObjectId(params: Protocol.HeapProfiler.GetObjectByHeapObjectIdRequest): 3132 Promise<Protocol.HeapProfiler.GetObjectByHeapObjectIdResponse>; 3133 3134 getSamplingProfile(): Promise<Protocol.HeapProfiler.GetSamplingProfileResponse>; 3135 3136 startSampling(params: Protocol.HeapProfiler.StartSamplingRequest): Promise<void>; 3137 3138 startTrackingHeapObjects(params: Protocol.HeapProfiler.StartTrackingHeapObjectsRequest): Promise<void>; 3139 3140 stopSampling(): Promise<Protocol.HeapProfiler.StopSamplingResponse>; 3141 3142 stopTrackingHeapObjects(params: Protocol.HeapProfiler.StopTrackingHeapObjectsRequest): Promise<void>; 3143 3144 takeHeapSnapshot(params: Protocol.HeapProfiler.TakeHeapSnapshotRequest): Promise<void>; 3145 3146 on(event: 'addHeapSnapshotChunk', 3147 listener: (params: Protocol.HeapProfiler.AddHeapSnapshotChunkEvent) => void): void; 3148 3149 /** 3150 * If heap objects tracking has been started then backend may send update for one or more fragments 3151 */ 3152 on(event: 'heapStatsUpdate', listener: (params: Protocol.HeapProfiler.HeapStatsUpdateEvent) => void): void; 3153 3154 /** 3155 * If heap objects tracking has been started then backend regularly sends a current value for last 3156 * seen object id and corresponding timestamp. If the were changes in the heap since last event 3157 * then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. 3158 */ 3159 on(event: 'lastSeenObjectId', listener: (params: Protocol.HeapProfiler.LastSeenObjectIdEvent) => void): void; 3160 3161 on(event: 'reportHeapSnapshotProgress', 3162 listener: (params: Protocol.HeapProfiler.ReportHeapSnapshotProgressEvent) => void): void; 3163 3164 on(event: 'resetProfiles', listener: () => void): void; 3165 } 3166 3167 export interface ProfilerApi { 3168 disable(): Promise<void>; 3169 3170 enable(): Promise<void>; 3171 3172 /** 3173 * Collect coverage data for the current isolate. The coverage data may be incomplete due to 3174 * garbage collection. 3175 */ 3176 getBestEffortCoverage(): Promise<Protocol.Profiler.GetBestEffortCoverageResponse>; 3177 3178 /** 3179 * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. 3180 */ 3181 setSamplingInterval(params: Protocol.Profiler.SetSamplingIntervalRequest): Promise<void>; 3182 3183 start(): Promise<void>; 3184 3185 /** 3186 * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code 3187 * coverage may be incomplete. Enabling prevents running optimized code and resets execution 3188 * counters. 3189 */ 3190 startPreciseCoverage(params: Protocol.Profiler.StartPreciseCoverageRequest): 3191 Promise<Protocol.Profiler.StartPreciseCoverageResponse>; 3192 3193 /** 3194 * Enable type profile. 3195 */ 3196 startTypeProfile(): Promise<void>; 3197 3198 stop(): Promise<Protocol.Profiler.StopResponse>; 3199 3200 /** 3201 * Disable precise code coverage. Disabling releases unnecessary execution count records and allows 3202 * executing optimized code. 3203 */ 3204 stopPreciseCoverage(): Promise<void>; 3205 3206 /** 3207 * Disable type profile. Disabling releases type profile data collected so far. 3208 */ 3209 stopTypeProfile(): Promise<void>; 3210 3211 /** 3212 * Collect coverage data for the current isolate, and resets execution counters. Precise code 3213 * coverage needs to have started. 3214 */ 3215 takePreciseCoverage(): Promise<Protocol.Profiler.TakePreciseCoverageResponse>; 3216 3217 /** 3218 * Collect type profile. 3219 */ 3220 takeTypeProfile(): Promise<Protocol.Profiler.TakeTypeProfileResponse>; 3221 3222 /** 3223 * Enable run time call stats collection. 3224 */ 3225 enableRuntimeCallStats(): Promise<void>; 3226 3227 /** 3228 * Disable run time call stats collection. 3229 */ 3230 disableRuntimeCallStats(): Promise<void>; 3231 3232 /** 3233 * Retrieve run time call stats. 3234 */ 3235 getRuntimeCallStats(): Promise<Protocol.Profiler.GetRuntimeCallStatsResponse>; 3236 3237 on(event: 'consoleProfileFinished', 3238 listener: (params: Protocol.Profiler.ConsoleProfileFinishedEvent) => void): void; 3239 3240 /** 3241 * Sent when new profile recording is started using console.profile() call. 3242 */ 3243 on(event: 'consoleProfileStarted', listener: (params: Protocol.Profiler.ConsoleProfileStartedEvent) => void): void; 3244 3245 /** 3246 * Reports coverage delta since the last poll (either from an event like this, or from 3247 * `takePreciseCoverage` for the current isolate. May only be sent if precise code 3248 * coverage has been started. This event can be trigged by the embedder to, for example, 3249 * trigger collection of coverage data immediatelly at a certain point in time. 3250 */ 3251 on(event: 'preciseCoverageDeltaUpdate', 3252 listener: (params: Protocol.Profiler.PreciseCoverageDeltaUpdateEvent) => void): void; 3253 } 3254 3255 export interface RuntimeApi { 3256 /** 3257 * Add handler to promise with given promise object id. 3258 */ 3259 awaitPromise(params: Protocol.Runtime.AwaitPromiseRequest): Promise<Protocol.Runtime.AwaitPromiseResponse>; 3260 3261 /** 3262 * Calls function with given declaration on the given object. Object group of the result is 3263 * inherited from the target object. 3264 */ 3265 callFunctionOn(params: Protocol.Runtime.CallFunctionOnRequest): Promise<Protocol.Runtime.CallFunctionOnResponse>; 3266 3267 /** 3268 * Compiles expression. 3269 */ 3270 compileScript(params: Protocol.Runtime.CompileScriptRequest): Promise<Protocol.Runtime.CompileScriptResponse>; 3271 3272 /** 3273 * Disables reporting of execution contexts creation. 3274 */ 3275 disable(): Promise<void>; 3276 3277 /** 3278 * Discards collected exceptions and console API calls. 3279 */ 3280 discardConsoleEntries(): Promise<void>; 3281 3282 /** 3283 * Enables reporting of execution contexts creation by means of `executionContextCreated` event. 3284 * When the reporting gets enabled the event will be sent immediately for each existing execution 3285 * context. 3286 */ 3287 enable(): Promise<void>; 3288 3289 /** 3290 * Evaluates expression on global object. 3291 */ 3292 evaluate(params: Protocol.Runtime.EvaluateRequest): Promise<Protocol.Runtime.EvaluateResponse>; 3293 3294 /** 3295 * Returns the isolate id. 3296 */ 3297 getIsolateId(): Promise<Protocol.Runtime.GetIsolateIdResponse>; 3298 3299 /** 3300 * Returns the JavaScript heap usage. 3301 * It is the total usage of the corresponding isolate not scoped to a particular Runtime. 3302 */ 3303 getHeapUsage(): Promise<Protocol.Runtime.GetHeapUsageResponse>; 3304 3305 /** 3306 * Returns properties of a given object. Object group of the result is inherited from the target 3307 * object. 3308 */ 3309 getProperties(params: Protocol.Runtime.GetPropertiesRequest): Promise<Protocol.Runtime.GetPropertiesResponse>; 3310 3311 /** 3312 * Returns all let, const and class variables from global scope. 3313 */ 3314 globalLexicalScopeNames(params: Protocol.Runtime.GlobalLexicalScopeNamesRequest): 3315 Promise<Protocol.Runtime.GlobalLexicalScopeNamesResponse>; 3316 3317 queryObjects(params: Protocol.Runtime.QueryObjectsRequest): Promise<Protocol.Runtime.QueryObjectsResponse>; 3318 3319 /** 3320 * Releases remote object with given id. 3321 */ 3322 releaseObject(params: Protocol.Runtime.ReleaseObjectRequest): Promise<void>; 3323 3324 /** 3325 * Releases all remote objects that belong to a given group. 3326 */ 3327 releaseObjectGroup(params: Protocol.Runtime.ReleaseObjectGroupRequest): Promise<void>; 3328 3329 /** 3330 * Tells inspected instance to run if it was waiting for debugger to attach. 3331 */ 3332 runIfWaitingForDebugger(): Promise<void>; 3333 3334 /** 3335 * Runs script with given id in a given context. 3336 */ 3337 runScript(params: Protocol.Runtime.RunScriptRequest): Promise<Protocol.Runtime.RunScriptResponse>; 3338 3339 /** 3340 * Enables or disables async call stacks tracking. 3341 */ 3342 setAsyncCallStackDepth(params: Protocol.Runtime.SetAsyncCallStackDepthRequest): Promise<void>; 3343 3344 setCustomObjectFormatterEnabled(params: Protocol.Runtime.SetCustomObjectFormatterEnabledRequest): Promise<void>; 3345 3346 setMaxCallStackSizeToCapture(params: Protocol.Runtime.SetMaxCallStackSizeToCaptureRequest): Promise<void>; 3347 3348 /** 3349 * Terminate current or next JavaScript execution. 3350 * Will cancel the termination when the outer-most script execution ends. 3351 */ 3352 terminateExecution(): Promise<void>; 3353 3354 /** 3355 * If executionContextId is empty, adds binding with the given name on the 3356 * global objects of all inspected contexts, including those created later, 3357 * bindings survive reloads. 3358 * If executionContextId is specified, adds binding only on global object of 3359 * given execution context. 3360 * Binding function takes exactly one argument, this argument should be string, 3361 * in case of any other input, function throws an exception. 3362 * Each binding function call produces Runtime.bindingCalled notification. 3363 */ 3364 addBinding(params: Protocol.Runtime.AddBindingRequest): Promise<void>; 3365 3366 /** 3367 * This method does not remove binding function from global object but 3368 * unsubscribes current runtime agent from Runtime.bindingCalled notifications. 3369 */ 3370 removeBinding(params: Protocol.Runtime.RemoveBindingRequest): Promise<void>; 3371 3372 /** 3373 * Notification is issued every time when binding is called. 3374 */ 3375 on(event: 'bindingCalled', listener: (params: Protocol.Runtime.BindingCalledEvent) => void): void; 3376 3377 /** 3378 * Issued when console API was called. 3379 */ 3380 on(event: 'consoleAPICalled', listener: (params: Protocol.Runtime.ConsoleAPICalledEvent) => void): void; 3381 3382 /** 3383 * Issued when unhandled exception was revoked. 3384 */ 3385 on(event: 'exceptionRevoked', listener: (params: Protocol.Runtime.ExceptionRevokedEvent) => void): void; 3386 3387 /** 3388 * Issued when exception was thrown and unhandled. 3389 */ 3390 on(event: 'exceptionThrown', listener: (params: Protocol.Runtime.ExceptionThrownEvent) => void): void; 3391 3392 /** 3393 * Issued when new execution context is created. 3394 */ 3395 on(event: 'executionContextCreated', 3396 listener: (params: Protocol.Runtime.ExecutionContextCreatedEvent) => void): void; 3397 3398 /** 3399 * Issued when execution context is destroyed. 3400 */ 3401 on(event: 'executionContextDestroyed', 3402 listener: (params: Protocol.Runtime.ExecutionContextDestroyedEvent) => void): void; 3403 3404 /** 3405 * Issued when all executionContexts were cleared in browser 3406 */ 3407 on(event: 'executionContextsCleared', listener: () => void): void; 3408 3409 /** 3410 * Issued when object should be inspected (for example, as a result of inspect() command line API 3411 * call). 3412 */ 3413 on(event: 'inspectRequested', listener: (params: Protocol.Runtime.InspectRequestedEvent) => void): void; 3414 } 3415 3416 export interface SchemaApi { 3417 /** 3418 * Returns supported domains. 3419 */ 3420 getDomains(): Promise<Protocol.Schema.GetDomainsResponse>; 3421 } 3422} 3423