stable (1.2) stable RC (1.3) latest (tip-of-tree) v8-inspector (node) Home
Domains
Accessibility Animation ApplicationCache Audits Browser CSS CacheStorage Console DOM DOMDebugger DOMSnapshot DOMStorage Database Debugger DeviceOrientation Emulation HeadlessExperimental HeapProfiler IO IndexedDB Input Inspector LayerTree Log Memory Network Overlay Page Performance Profiler Runtime Schema Security ServiceWorker Storage SystemInfo Target Tethering Tracing
Chrome DevTools Protocol Viewer - latest (tip-of-tree)

Page Domain

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

Methods

Page.addScriptToEvaluateOnLoad

Deprecated, please use addScriptToEvaluateOnNewDocument instead. Experimental Deprecated

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

Page.addScriptToEvaluateOnNewDocument

Evaluates given script in every frame upon creation (before loading frame's scripts).

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

Page.bringToFront

Brings page to front (activates tab).

Page.captureScreenshot

Capture page screenshot.

Parameters
format
string Image compression format (defaults to png). Allowed values: jpeg, png.
quality
integer Compression quality from range [0..100] (jpeg only).
clip
Viewport Capture the screenshot of a given region only.
fromSurface
boolean Capture the screenshot from the surface, rather than the view. Defaults to true. Experimental
Return object
data
string Base64-encoded image data.

Page.createIsolatedWorld

Creates an isolated world for the given frame.

Parameters
frameId
FrameId Id of the frame in which the isolated world should be created.
worldName
string An optional name which is reported in the Execution Context.
grantUniveralAccess
boolean Whether or not universal access should be granted to the isolated world. This is a powerful option, use with caution.
Return object
executionContextId
Runtime.ExecutionContextId Execution context of the isolated world.

Page.disable

Disables page domain notifications.

Page.enable

Enables page domain notifications.

Page.getAppManifest

Return object
url
string Manifest location.
errors
array [ AppManifestError ]
data
string Manifest content.

Page.getFrameTree

Returns present frame tree structure.

Return object
frameTree
FrameTree Present frame tree structure.

Page.getLayoutMetrics

Returns metrics relating to the layouting of the page, such as viewport bounds/scale.

Return object
layoutViewport
LayoutViewport Metrics relating to the layout viewport.
visualViewport
VisualViewport Metrics relating to the visual viewport.
contentSize
DOM.Rect Size of scrollable area.

Page.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.

Page.getResourceContent

Returns content of the given resource. Experimental

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.

Page.getResourceTree

Returns present frame / resource tree structure. Experimental

Return object
frameTree
FrameResourceTree Present frame / resource tree structure.

Page.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.

Page.navigate

Navigates current page to the given URL.

Parameters
url
string URL to navigate the page to.
referrer
string Referrer URL.
transitionType
TransitionType Intended transition type.
Return object
frameId
FrameId Frame id that has navigated (or failed to navigate)
loaderId
Network.LoaderId Loader identifier.
errorText
string User friendly error message, present if and only if navigation has failed.

Page.navigateToHistoryEntry

Navigates current page to the given history entry.

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

Page.printToPDF

Print page as PDF.

Parameters
landscape
boolean Paper orientation. Defaults to false.
displayHeaderFooter
boolean Display header and footer. Defaults to false.
printBackground
boolean Print background graphics. Defaults to false.
scale
number Scale of the webpage rendering. Defaults to 1.
paperWidth
number Paper width in inches. Defaults to 8.5 inches.
paperHeight
number Paper height in inches. Defaults to 11 inches.
marginTop
number Top margin in inches. Defaults to 1cm (~0.4 inches).
marginBottom
number Bottom margin in inches. Defaults to 1cm (~0.4 inches).
marginLeft
number Left margin in inches. Defaults to 1cm (~0.4 inches).
marginRight
number Right margin in inches. Defaults to 1cm (~0.4 inches).
pageRanges
string Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
ignoreInvalidPageRanges
boolean Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false.
Return object
data
string Base64-encoded pdf data.

Page.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.

Page.removeScriptToEvaluateOnLoad

Deprecated, please use removeScriptToEvaluateOnNewDocument instead. Experimental Deprecated

Parameters
identifier
ScriptIdentifier

Page.removeScriptToEvaluateOnNewDocument

Removes given script from the list.

Parameters
identifier
ScriptIdentifier

Page.requestAppBanner

Experimental

Page.screencastFrameAck

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

Parameters
sessionId
integer Frame number.

Page.searchInResource

Searches for given string in resource content. Experimental

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.

Page.setAdBlockingEnabled

Enable Chrome's experimental ad filter on all sites. Experimental

Parameters
enabled
boolean Whether to block ads.

Page.setAutoAttachToCreatedPages

Controls whether browser will open a new inspector window for connected pages. Experimental

Parameters
autoAttach
boolean If true, browser will open a new inspector window for every page created from this one.

Page.setDocumentContent

Sets given markup as the document's HTML.

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

Page.setDownloadBehavior

Set the behavior when downloading a file. Experimental

Parameters
behavior
string Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny). Allowed values: deny, allow, default.
downloadPath
string The default path to save downloaded files to. This is requred if behavior is set to 'allow'

Page.setLifecycleEventsEnabled

Controls whether page will emit lifecycle events. Experimental

Parameters
enabled
boolean If true, starts emitting lifecycle events.

Page.startScreencast

Starts sending each frame using the `screencastFrame` event. Experimental

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.
everyNthFrame
integer Send every n-th frame.

Page.stopLoading

Force the page stop all navigations and pending resource fetches.

Page.stopScreencast

Stops sending each frame in the `screencastFrame`. Experimental

Events

Page.domContentEventFired

Parameters

Page.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.
stack
Runtime.StackTrace JavaScript stack trace of when frame was attached, only set if frame initiated from script.

Page.frameClearedScheduledNavigation

Fired when frame no longer has a scheduled navigation. Experimental

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

Page.frameDetached

Fired when frame has been detached from its parent.

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

Page.frameNavigated

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

Parameters
frame
Frame Frame object.

Page.frameResized

Experimental

Page.frameScheduledNavigation

Fired when frame schedules a potential navigation. Experimental

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.
reason
string The reason for the navigation. Allowed values: formSubmissionGet, formSubmissionPost, httpHeaderRefresh, scriptInitiated, metaTagRefresh, pageBlockInterstitial, reload.
url
string The destination URL for the scheduled navigation.

Page.frameStartedLoading

Fired when frame has started loading. Experimental

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

Page.frameStoppedLoading

Fired when frame has stopped loading. Experimental

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

Page.interstitialHidden

Fired when interstitial page was hidden

Page.interstitialShown

Fired when interstitial page was shown

Page.javascriptDialogClosed

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

Parameters
result
boolean Whether dialog was confirmed.
userInput
string User input in case of prompt.

Page.javascriptDialogOpening

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

Parameters
url
string Frame url.
message
string Message that will be displayed by the dialog.
type
DialogType Dialog type.
defaultPrompt
string Default dialog prompt.

Page.lifecycleEvent

Fired for top level page lifecycle events such as navigation, load, paint, etc.

Parameters
frameId
FrameId Id of the frame.
loaderId
Network.LoaderId Loader identifier. Empty string if the request is fetched from worker.
name
string

Page.loadEventFired

Parameters

Page.screencastFrame

Compressed image data requested by the `startScreencast`. Experimental

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

Page.screencastVisibilityChanged

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

Parameters
visible
boolean True if the page is visible.

Page.windowOpen

Fired when a new window is going to be opened, via window.open(), link click, form submission, etc.

Parameters
url
string The URL for the new window.
windowName
string Window name.
windowFeatures
array [string] An array of enabled window features.
userGesture
boolean Whether or not it was triggered by user gesture.

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, Manifest, 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.
unreachableUrl
string If the frame failed to load, this contains the URL that could not be loaded. Experimental

FrameResource

Information about the Resource on the page. Experimental

Type: object

Properties
url
string Resource URL.
type
ResourceType Type of this resource.
mimeType
string Resource mimeType as determined by the browser.
lastModified
Network.TimeSinceEpoch last-modified timestamp as reported by server.
contentSize
number Resource content size.
failed
boolean True if the resource failed to load.
canceled
boolean True if the resource was canceled during loading.

FrameResourceTree

Information about the Frame hierarchy along with their cached resources. Experimental

Type: object

Properties
frame
Frame Frame information for this tree item.
childFrames
array [ FrameResourceTree ] Child frames.
resources
array [ FrameResource ] Information about frame resources.

FrameTree

Information about the Frame hierarchy.

Type: object

Properties
frame
Frame Frame information for this tree item.
childFrames
array [ FrameTree ] Child frames.

ScriptIdentifier

Unique script identifier.

Type: string

TransitionType

Transition type.

Type: string

Allowed values

link, typed, auto_bookmark, auto_subframe, manual_subframe, generated, auto_toplevel, form_submit, reload, keyword, keyword_generated, other.

NavigationEntry

Navigation history entry.

Type: object

Properties
id
integer Unique id of the navigation history entry.
url
string URL of the navigation history entry.
userTypedURL
string URL that the user typed in the url bar.
title
string Title of the navigation history entry.
transitionType
TransitionType Transition type.

ScreencastFrameMetadata

Screencast frame metadata. Experimental

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
Network.TimeSinceEpoch Frame swap timestamp.

DialogType

Javascript dialog type.

Type: string

Allowed values

alert, confirm, prompt, beforeunload.

AppManifestError

Error while paring app manifest.

Type: object

Properties
message
string Error message.
critical
integer If criticial, this is a non-recoverable parse error.
line
integer Error line.
column
integer Error column.

LayoutViewport

Layout viewport position and dimensions.

Type: object

Properties
pageX
integer Horizontal offset relative to the document (CSS pixels).
pageY
integer Vertical offset relative to the document (CSS pixels).
clientWidth
integer Width (CSS pixels), excludes scrollbar if present.
clientHeight
integer Height (CSS pixels), excludes scrollbar if present.

VisualViewport

Visual viewport position, dimensions, and scale.

Type: object

Properties
offsetX
number Horizontal offset relative to the layout viewport (CSS pixels).
offsetY
number Vertical offset relative to the layout viewport (CSS pixels).
pageX
number Horizontal offset relative to the document (CSS pixels).
pageY
number Vertical offset relative to the document (CSS pixels).
clientWidth
number Width (CSS pixels), excludes scrollbar if present.
clientHeight
number Height (CSS pixels), excludes scrollbar if present.
scale
number Scale relative to the ideal viewport (size at width=device-width).

Viewport

Viewport for capturing screenshot.

Type: object

Properties
x
number X offset in CSS pixels.
y
number Y offset in CSS pixels
width
number Rectangle width in CSS pixels
height
number Rectangle height in CSS pixels
scale
number Page scale factor.