Chrome Remote Interface v0.4.1 ChromeRemoteInterface.RPC.Page View Source

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

Link to this section Summary

Functions

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

Brings page to front (activates tab).

Capture page screenshot.

Creates an isolated world for the given frame.

Disables page domain notifications.

Enables page domain notifications.

Returns present frame tree structure.

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

Returns navigation history for the current page.

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

Navigates current page to the given URL.

Navigates current page to the given history entry.

Print page as PDF.

Reloads given page optionally ignoring the cache.

Removes given script from the list.

Resets navigation history for the current page.

Sets given markup as the document's HTML.

Force the page stop all navigations and pending resource fetches.

Link to this section Functions

Link to this function

addScriptToEvaluateOnNewDocument(page_pid) View Source

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

Parameters: source - - worldName - - If specified, creates an isolated world with the given name and evaluates given script in it. This world name will be used as the ExecutionContextDescription::name when the corresponding event is emitted.

Link to this function

addScriptToEvaluateOnNewDocument(page_pid, parameters) View Source

Link to this function

addScriptToEvaluateOnNewDocument(page_pid, parameters, opts) View Source

Brings page to front (activates tab).

Parameters:

Link to this function

bringToFront(page_pid, parameters) View Source

Link to this function

bringToFront(page_pid, parameters, opts) View Source

Link to this function

captureScreenshot(page_pid) View Source

Capture page screenshot.

Parameters: format - - Image compression format (defaults to png).quality - - Compression quality from range [0..100] (jpeg only).clip - - Capture the screenshot of a given region only.fromSurface - - Capture the screenshot from the surface, rather than the view. Defaults to true.

Link to this function

captureScreenshot(page_pid, parameters) View Source

Link to this function

captureScreenshot(page_pid, parameters, opts) View Source

Link to this function

createIsolatedWorld(page_pid) View Source

Creates an isolated world for the given frame.

Parameters: frameId - - Id of the frame in which the isolated world should be created.worldName - - An optional name which is reported in the Execution Context.grantUniveralAccess - - Whether or not universal access should be granted to the isolated world. This is a powerful option, use with caution.

Link to this function

createIsolatedWorld(page_pid, parameters) View Source

Link to this function

createIsolatedWorld(page_pid, parameters, opts) View Source

Disables page domain notifications.

Parameters:

Link to this function

disable(page_pid, parameters) View Source

Link to this function

disable(page_pid, parameters, opts) View Source

Enables page domain notifications.

Parameters:

Link to this function

enable(page_pid, parameters) View Source

Link to this function

enable(page_pid, parameters, opts) View Source

Link to this function

getAppManifest(page_pid) View Source

Parameters:

Link to this function

getAppManifest(page_pid, parameters) View Source

Link to this function

getAppManifest(page_pid, parameters, opts) View Source

Returns present frame tree structure.

Parameters:

Link to this function

getFrameTree(page_pid, parameters) View Source

Link to this function

getFrameTree(page_pid, parameters, opts) View Source

Link to this function

getLayoutMetrics(page_pid) View Source

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

Parameters:

Link to this function

getLayoutMetrics(page_pid, parameters) View Source

Link to this function

getLayoutMetrics(page_pid, parameters, opts) View Source

Link to this function

getNavigationHistory(page_pid) View Source

Returns navigation history for the current page.

Parameters:

Link to this function

getNavigationHistory(page_pid, parameters) View Source

Link to this function

getNavigationHistory(page_pid, parameters, opts) View Source

Link to this function

handleJavaScriptDialog(page_pid) View Source

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

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

Link to this function

handleJavaScriptDialog(page_pid, parameters) View Source

Link to this function

handleJavaScriptDialog(page_pid, parameters, opts) View Source

Print page as PDF.

Parameters: landscape - - Paper orientation. Defaults to false.displayHeaderFooter - - Display header and footer. Defaults to false.printBackground - - Print background graphics. Defaults to false.scale - - Scale of the webpage rendering. Defaults to 1.paperWidth - - Paper width in inches. Defaults to 8.5 inches.paperHeight - - Paper height in inches. Defaults to 11 inches.marginTop - - Top margin in inches. Defaults to 1cm (~0.4 inches).marginBottom - - Bottom margin in inches. Defaults to 1cm (~0.4 inches).marginLeft - - Left margin in inches. Defaults to 1cm (~0.4 inches).marginRight - - Right margin in inches. Defaults to 1cm (~0.4 inches).pageRanges - - Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.ignoreInvalidPageRanges - - Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false.headerTemplate - - HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them:

  • date: formatted print date
  • title: document title
  • url: document location
  • pageNumber: current page number
  • totalPages: total pages in the document

For example, <span class=title></span> would generate span containing the title.footerTemplate - - HTML template for the print footer. Should use the same format as the headerTemplate.preferCSSPageSize - - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.transferMode - - return as stream

Link to this function

printToPDF(page_pid, parameters) View Source

Link to this function

printToPDF(page_pid, parameters, opts) View Source

Reloads given page optionally ignoring the cache.

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

Link to this function

reload(page_pid, parameters) View Source

Link to this function

reload(page_pid, parameters, opts) View Source

Link to this function

removeScriptToEvaluateOnNewDocument(page_pid) View Source

Removes given script from the list.

Parameters: identifier - -

Link to this function

removeScriptToEvaluateOnNewDocument(page_pid, parameters) View Source

Link to this function

removeScriptToEvaluateOnNewDocument(page_pid, parameters, opts) View Source

Link to this function

resetNavigationHistory(page_pid) View Source

Resets navigation history for the current page.

Parameters:

Link to this function

resetNavigationHistory(page_pid, parameters) View Source

Link to this function

resetNavigationHistory(page_pid, parameters, opts) View Source

Link to this function

setDocumentContent(page_pid) View Source

Sets given markup as the document's HTML.

Parameters: frameId - - Frame id to set HTML for.html - - HTML content to set.

Link to this function

setDocumentContent(page_pid, parameters) View Source

Link to this function

setDocumentContent(page_pid, parameters, opts) View Source

Force the page stop all navigations and pending resource fetches.

Parameters:

Link to this function

stopLoading(page_pid, parameters) View Source

Link to this function

stopLoading(page_pid, parameters, opts) View Source