Domains Accessibility Animation ApplicationCache CSS CacheStorage Console DOM DOMDebugger DOMStorage Database Debugger DeviceOrientation Emulation FileSystem HeapProfiler IndexedDB Input Inspector LayerTree Memory Network Page Power Profiler Rendering Runtime ScreenOrientation Security ServiceWorker Timeline Tracing Worker
Chrome Debugger Protocol Viewer

Page Domain

Actions and events related to the inspected page belong to the page domain.

Methods

enable

Enables page domain notifications.

disable

Disables page domain notifications.

addScriptToEvaluateOnLoad

Parameters
scriptSource
string
Return object
identifier
ScriptIdentifier Identifier of the added script.

removeScriptToEvaluateOnLoad

Parameters
identifier
ScriptIdentifier

reload

Reloads given page optionally ignoring the cache.

Parameters
ignoreCache
boolean If true, browser cache is ignored (as if the user pressed Shift+refresh).
scriptToEvaluateOnLoad
string If set, the script will be injected into all frames of the inspected page after reload.

navigate

Navigates current page to the given URL.

Parameters
url
string URL to navigate the page to.
Return object
frameId
FrameId Frame id that will be navigated.

getNavigationHistory

Returns navigation history for the current page.

Return object
currentIndex
integer Index of the current navigation history entry.
entries
array [ NavigationEntry ] Array of navigation history entries.

navigateToHistoryEntry

Navigates current page to the given history entry.

Parameters
entryId
integer Unique id of the entry to navigate to.

getResourceTree

Returns present frame / resource tree structure.

Return object
frameTree
FrameResourceTree Present frame / resource tree structure.

getResourceContent

Returns content of the given resource.

Parameters
frameId
FrameId Frame id to get resource for.
url
string URL of the resource to get content for.
Return object
content
string Resource content.
base64Encoded
boolean True, if content was served as base64.

searchInResource

Searches for given string in resource content.

Parameters
frameId
FrameId Frame id for resource to search in.
url
string URL of the resource to search in.
query
string String to search for.
caseSensitive
boolean If true, search is case sensitive.
isRegex
boolean If true, treats string parameter as regex.
Return object
result
array [ Debugger.SearchMatch ] List of search matches.

setDocumentContent

Sets given markup as the document's HTML.

Parameters
frameId
FrameId Frame id to set HTML for.
html
string HTML content to set.

captureScreenshot

Capture page screenshot.

Return object
data
string Base64-encoded image data (PNG).

canScreencast

Tells whether screencast is supported.

Return object
result
boolean True if screencast is supported.

startScreencast

Starts sending each frame using the screencastFrame event.

Parameters
format
string Image compression format. Allowed values: jpeg, png.
quality
integer Compression quality from range [0..100].
maxWidth
integer Maximum screenshot width.
maxHeight
integer Maximum screenshot height.

stopScreencast

Stops sending each frame in the screencastFrame.

screencastFrameAck

Acknowledges that a screencast frame has been received by the frontend.

Parameters
frameNumber
integer Frame number.

handleJavaScriptDialog

Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).

Parameters
accept
boolean Whether to accept or dismiss the dialog.
promptText
string The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog.

setShowViewportSizeOnResize

Paints viewport size upon main frame resize.

Parameters
show
boolean Whether to paint size or not.
showGrid
boolean Whether to paint grid as well.

setColorPickerEnabled

Shows / hides color picker

Parameters
enabled
boolean Shows / hides color picker

setOverlayMessage

Sets overlay message.

Parameters
message
string Overlay message to display when paused in debugger.

Events

domContentEventFired

Parameters
timestamp
number

loadEventFired

Parameters
timestamp
number

frameAttached

Fired when frame has been attached to its parent.

Parameters
frameId
FrameId Id of the frame that has been attached.
parentFrameId
FrameId Parent frame identifier.

frameNavigated

Fired once navigation of the frame has completed. Frame is now associated with the new loader.

Parameters
frame
Frame Frame object.

frameDetached

Fired when frame has been detached from its parent.

Parameters
frameId
FrameId Id of the frame that has been detached.

frameStartedLoading

Fired when frame has started loading.

Parameters
frameId
FrameId Id of the frame that has started loading.

frameStoppedLoading

Fired when frame has stopped loading.

Parameters
frameId
FrameId Id of the frame that has stopped loading.

frameScheduledNavigation

Fired when frame schedules a potential navigation.

Parameters
frameId
FrameId Id of the frame that has scheduled a navigation.
delay
number Delay (in seconds) until the navigation is scheduled to begin. The navigation is not guaranteed to start.

frameClearedScheduledNavigation

Fired when frame no longer has a scheduled navigation.

Parameters
frameId
FrameId Id of the frame that has cleared its scheduled navigation.

frameResized

javascriptDialogOpening

Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.

Parameters
message
string Message that will be displayed by the dialog.
type
DialogType Dialog type.

javascriptDialogClosed

Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed.

Parameters
result
boolean Whether dialog was confirmed.

screencastFrame

Compressed image data requested by the startScreencast.

Parameters
data
string Base64-encoded compressed image.
metadata
ScreencastFrameMetadata Screencast frame metadata.
frameNumber
integer Frame number.

screencastVisibilityChanged

Fired when the page with currently enabled screencast was shown or hidden .

Parameters
visible
boolean True if the page is visible.

colorPicked

Fired when a color has been picked.

Parameters
color
DOM.RGBA RGBA of the picked color.

interstitialShown

Fired when interstitial page was shown

interstitialHidden

Fired when interstitial page was hidden

Types

ResourceType

Resource type as it was perceived by the rendering engine.

Type: string

Allowed values

Document, Stylesheet, Image, Media, Font, Script, TextTrack, XHR, Fetch, EventSource, WebSocket, Other.

FrameId

Unique frame identifier.

Type: string

Frame

Information about the Frame on the page.

Type: object

Properties
id
string Frame unique identifier.
parentId
string Parent frame identifier.
loaderId
Network.LoaderId Identifier of the loader associated with this frame.
name
string Frame's name as specified in the tag.
url
string Frame document's URL.
securityOrigin
string Frame document's security origin.
mimeType
string Frame document's mimeType as determined by the browser.

FrameResourceTree

Information about the Frame hierarchy along with their cached resources.

Type: object

Properties
frame
Frame Frame information for this tree item.
childFrames
array [ FrameResourceTree ] Child frames.
resources
array [object] Information about frame resources.
Array element:
url
string Resource URL.
type
ResourceType Type of this resource.
mimeType
string Resource mimeType as determined by the browser.
failed
boolean True if the resource failed to load.
canceled
boolean True if the resource was canceled during loading.

ScriptIdentifier

Unique script identifier.

Type: string

NavigationEntry

Navigation history entry.

Type: object

Properties
id
integer Unique id of the navigation history entry.
url
string URL of the navigation history entry.
title
string Title of the navigation history entry.

ScreencastFrameMetadata

Screencast frame metadata

Type: object

Properties
offsetTop
number Top offset in DIP.
pageScaleFactor
number Page scale factor.
deviceWidth
number Device screen width in DIP.
deviceHeight
number Device screen height in DIP.
scrollOffsetX
number Position of horizontal scroll in CSS pixels.
scrollOffsetY
number Position of vertical scroll in CSS pixels.
timestamp
number Frame swap timestamp.

DialogType

Javascript dialog type

Type: string

Allowed values

alert, confirm, prompt, beforeunload.