Chrome Remote Interface v0.0.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

Clears the overriden device metrics

Clears the overridden Device Orientation

Clears the overriden Geolocation Position and Error

Creates an isolated world for the given frame

Deletes browser cookie with given name, domain and path

Disables page domain notifications

Enables page domain notifications

Returns all browser cookies. Depending on the backend support, will return detailed cookie information in the cookies field

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

Returns navigation history for the current page

Returns content of the given resource

Returns present frame / resource tree structure

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

Should be sent in response to a navigationRequested or a redirectRequested event, telling the browser how to handle the navigation

Reloads given page optionally ignoring the cache

Acknowledges that a screencast frame has been received by the frontend

Searches for given string in resource content

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

Toggles navigation throttling which allows programatic control over navigation and redirect response

Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and “device-width”/“device-height”-related CSS media query results)

Sets given markup as the document’s HTML

Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable

Toggles mouse event-based touch event emulation

Starts sending each frame using the screencastFrame event

Force the page stop all navigations and pending resource fetches

Stops sending each frame in the screencastFrame

Link to this section Functions

Link to this function addScriptToEvaluateOnLoad(page_pid, parameters \\ %{}) View Source

Parameters: scriptSource - -

Link to this function captureScreenshot(page_pid, parameters \\ %{}) View Source

Capture page screenshot.

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

Link to this function clearDeviceMetricsOverride(page_pid, parameters \\ %{}) View Source

Clears the overriden device metrics.

Parameters:

Link to this function clearDeviceOrientationOverride(page_pid, parameters \\ %{}) View Source

Clears the overridden Device Orientation.

Parameters:

Link to this function clearGeolocationOverride(page_pid, parameters \\ %{}) View Source

Clears the overriden Geolocation Position and Error.

Parameters:

Link to this function createIsolatedWorld(page_pid, parameters \\ %{}) 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 deleteCookie(page_pid, parameters \\ %{}) View Source

Deletes browser cookie with given name, domain and path.

Parameters: cookieName - - Name of the cookie to remove.url - - URL to match cooke domain and path.

Link to this function disable(page_pid, parameters \\ %{}) View Source

Disables page domain notifications.

Parameters:

Link to this function enable(page_pid, parameters \\ %{}) View Source

Enables page domain notifications.

Parameters:

Link to this function getAppManifest(page_pid, parameters \\ %{}) View Source

Parameters:

Link to this function getCookies(page_pid, parameters \\ %{}) View Source

Returns all browser cookies. Depending on the backend support, will return detailed cookie information in the cookies field.

Parameters:

Link to this function getLayoutMetrics(page_pid, parameters \\ %{}) View Source

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

Parameters:

Link to this function getNavigationHistory(page_pid, parameters \\ %{}) View Source

Returns navigation history for the current page.

Parameters:

Link to this function getResourceContent(page_pid, parameters \\ %{}) View Source

Returns content of the given resource.

Parameters: frameId - - Frame id to get resource for.url - - URL of the resource to get content for.

Link to this function getResourceTree(page_pid, parameters \\ %{}) View Source

Returns present frame / resource tree structure.

Parameters:

Link to this function handleJavaScriptDialog(page_pid, parameters \\ %{}) 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 printToPDF(page_pid, parameters \\ %{}) 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.

Link to this function processNavigation(page_pid, parameters \\ %{}) View Source

Should be sent in response to a navigationRequested or a redirectRequested event, telling the browser how to handle the navigation.

Parameters: response - - navigationId - -

Link to this function reload(page_pid, parameters \\ %{}) 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.

Link to this function removeScriptToEvaluateOnLoad(page_pid, parameters \\ %{}) View Source

Parameters: identifier - -

Link to this function requestAppBanner(page_pid, parameters \\ %{}) View Source

Parameters:

Link to this function screencastFrameAck(page_pid, parameters \\ %{}) View Source

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

Parameters: sessionId - - Frame number.

Link to this function searchInResource(page_pid, parameters \\ %{}) View Source

Searches for given string in resource content.

Parameters: frameId - - Frame id for resource to search in.url - - URL of the resource to search in.query - - String to search for.caseSensitive - - If true, search is case sensitive.isRegex - - If true, treats string parameter as regex.

Link to this function setAutoAttachToCreatedPages(page_pid, parameters \\ %{}) View Source

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

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

Link to this function setControlNavigations(page_pid, parameters \\ %{}) View Source

Toggles navigation throttling which allows programatic control over navigation and redirect response.

Parameters: enabled - -

Link to this function setDeviceMetricsOverride(page_pid, parameters \\ %{}) View Source

Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and “device-width”/“device-height”-related CSS media query results).

Parameters: width - - Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.height - - Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.deviceScaleFactor - - Overriding device scale factor value. 0 disables the override.mobile - - Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.fitWindow - - Whether a view that exceeds the available browser window area should be scaled down to fit.scale - - Scale to apply to resulting view image. Ignored in |fitWindow| mode.offsetX - - X offset to shift resulting view image by. Ignored in |fitWindow| mode.offsetY - - Y offset to shift resulting view image by. Ignored in |fitWindow| mode.screenWidth - - Overriding screen width value in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.screenHeight - - Overriding screen height value in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.positionX - - Overriding view X position on screen in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.positionY - - Overriding view Y position on screen in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.screenOrientation - - Screen orientation override.

Link to this function setDeviceOrientationOverride(page_pid, parameters \\ %{}) View Source

Overrides the Device Orientation.

Parameters: alpha - - Mock alphabeta - - Mock betagamma - - Mock gamma

Link to this function setDocumentContent(page_pid, parameters \\ %{}) 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 setGeolocationOverride(page_pid, parameters \\ %{}) View Source

Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable.

Parameters: latitude - - Mock latitudelongitude - - Mock longitudeaccuracy - - Mock accuracy

Link to this function setTouchEmulationEnabled(page_pid, parameters \\ %{}) View Source

Toggles mouse event-based touch event emulation.

Parameters: enabled - - Whether the touch event emulation should be enabled.configuration - - Touch/gesture events configuration. Default: current platform.

Link to this function startScreencast(page_pid, parameters \\ %{}) View Source

Starts sending each frame using the screencastFrame event.

Parameters: format - - Image compression format.quality - - Compression quality from range [0..100].maxWidth - - Maximum screenshot width.maxHeight - - Maximum screenshot height.everyNthFrame - - Send every n-th frame.

Link to this function stopLoading(page_pid, parameters \\ %{}) View Source

Force the page stop all navigations and pending resource fetches.

Parameters:

Link to this function stopScreencast(page_pid, parameters \\ %{}) View Source

Stops sending each frame in the screencastFrame.

Parameters: