public interface Browser
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close browser gracefully.
|
void |
crash()
Crashes browser on the main thread.
|
void |
crashGpuProcess()
Crashes GPU process.
|
List<String> |
getBrowserCommandLine()
Returns the command line switches for the browser process if, and only if --enable-automation
is on the commandline.
|
Histogram |
getHistogram(String name)
Get a Chrome histogram by name.
|
Histogram |
getHistogram(String name,
Boolean delta)
Get a Chrome histogram by name.
|
List<Histogram> |
getHistograms()
Get Chrome histograms.
|
List<Histogram> |
getHistograms(String query,
Boolean delta)
Get Chrome histograms.
|
Version |
getVersion()
Returns version information.
|
Bounds |
getWindowBounds(Integer windowId)
Get position and size of the browser window.
|
WindowForTarget |
getWindowForTarget()
Get the browser window that contains the devtools target.
|
WindowForTarget |
getWindowForTarget(String targetId)
Get the browser window that contains the devtools target.
|
void |
grantPermissions(String origin,
List<PermissionType> permissions)
Grant specific permissions to the given origin and reject all others.
|
void |
grantPermissions(String origin,
List<PermissionType> permissions,
String browserContextId)
Grant specific permissions to the given origin and reject all others.
|
void |
resetPermissions()
Reset all permission management for all origins.
|
void |
resetPermissions(String browserContextId)
Reset all permission management for all origins.
|
void |
setDockTile()
Set dock tile details, platform-specific.
|
void |
setDockTile(String badgeLabel,
String image)
Set dock tile details, platform-specific.
|
void |
setPermission(String origin,
PermissionDescriptor permission,
PermissionSetting setting)
Set permission settings for given origin.
|
void |
setPermission(String origin,
PermissionDescriptor permission,
PermissionSetting setting,
String browserContextId)
Set permission settings for given origin.
|
void |
setWindowBounds(Integer windowId,
Bounds bounds)
Set position and/or size of the browser window.
|
void setPermission(String origin, PermissionDescriptor permission, PermissionSetting setting)
origin - Origin the permission applies to.permission - Descriptor of permission to override.setting - Setting of the permission.void setPermission(String origin, PermissionDescriptor permission, PermissionSetting setting, String browserContextId)
origin - Origin the permission applies to.permission - Descriptor of permission to override.setting - Setting of the permission.browserContextId - Context to override. When omitted, default browser context is used.void grantPermissions(String origin, List<PermissionType> permissions)
origin - permissions - void grantPermissions(String origin, List<PermissionType> permissions, String browserContextId)
origin - permissions - browserContextId - BrowserContext to override permissions. When omitted, default browser
context is used.void resetPermissions()
void resetPermissions(String browserContextId)
browserContextId - BrowserContext to reset permissions. When omitted, default browser
context is used.void close()
void crash()
void crashGpuProcess()
Version getVersion()
List<String> getBrowserCommandLine()
List<Histogram> getHistograms(String query, Boolean delta)
query - Requested substring in name. Only histograms which have query as a substring in
their name are extracted. An empty or absent query returns all histograms.delta - If true, retrieve delta since last call.Histogram getHistogram(String name)
name - Requested histogram name.Histogram getHistogram(String name, Boolean delta)
name - Requested histogram name.delta - If true, retrieve delta since last call.Bounds getWindowBounds(Integer windowId)
windowId - Browser window id.WindowForTarget getWindowForTarget()
WindowForTarget getWindowForTarget(String targetId)
targetId - Devtools agent host id. If called as a part of the session, associated targetId
is used.void setWindowBounds(Integer windowId, Bounds bounds)
windowId - Browser window id.bounds - New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be
combined with 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged.void setDockTile()
Copyright © 2020. All rights reserved.