public interface Target
Modifier and Type | Method | Description |
---|---|---|
void |
activateTarget(String targetId) |
Activates (focuses) the target.
|
String |
attachToTarget(String targetId) |
Attaches to the target with given id.
|
Boolean |
closeTarget(String targetId) |
Closes the target.
|
String |
createBrowserContext() |
Creates a new empty BrowserContext.
|
String |
createTarget(String url) |
Creates a new page.
|
String |
createTarget(String url,
Integer width,
Integer height,
String browserContextId,
Boolean enableBeginFrameControl) |
Creates a new page.
|
void |
detachFromTarget() |
Detaches session with given id.
|
void |
detachFromTarget(String sessionId,
String targetId) |
Detaches session with given id.
|
Boolean |
disposeBrowserContext(String browserContextId) |
Deletes a BrowserContext, will fail of any open page uses it.
|
TargetInfo |
getTargetInfo(String targetId) |
Returns information about a target.
|
List<TargetInfo> |
getTargets() |
Retrieves a list of available targets.
|
void |
sendMessageToTarget(String message) |
Sends protocol message over session with given id.
|
void |
sendMessageToTarget(String message,
String sessionId,
String targetId) |
Sends protocol message over session with given id.
|
void |
setAttachToFrames(Boolean value) |
|
void |
setAutoAttach(Boolean autoAttach,
Boolean waitForDebuggerOnStart) |
Controls whether to automatically attach to new targets which are considered to be related to
this one.
|
void |
setDiscoverTargets(Boolean discover) |
Controls whether to discover available targets and notify via
`targetCreated/targetInfoChanged/targetDestroyed` events.
|
void |
setRemoteLocations(List<RemoteLocation> locations) |
Enables target discovery for the specified locations, when
setDiscoverTargets was set to
true . |
void activateTarget(String targetId)
String attachToTarget(String targetId)
Boolean closeTarget(String targetId)
String createBrowserContext()
String createTarget(String url, Integer width, Integer height, String browserContextId, Boolean enableBeginFrameControl)
url
- The initial URL the page will be navigated to.width
- Frame width in DIP (headless chrome only).height
- Frame height in DIP (headless chrome only).browserContextId
- The browser context to create the page in (headless chrome only).enableBeginFrameControl
- Whether BeginFrames for this target will be controlled via DevTools (headless chrome only,
not supported on MacOS yet, false by default).void detachFromTarget(String sessionId, String targetId)
sessionId
- Session to detach.targetId
- Deprecated.Boolean disposeBrowserContext(String browserContextId)
TargetInfo getTargetInfo(String targetId)
List<TargetInfo> getTargets()
void sendMessageToTarget(String message, String sessionId, String targetId)
sessionId
- Identifier of the session.targetId
- Deprecated.void setAttachToFrames(Boolean value)
void setAutoAttach(Boolean autoAttach, Boolean waitForDebuggerOnStart)
autoAttach
- Whether to auto-attach to related targets.waitForDebuggerOnStart
- Whether to pause new targets when attaching to them. Use `Runtime.runIfWaitingForDebugger`
to run paused targets.void setDiscoverTargets(Boolean discover)
discover
- Whether to discover available targets.void setRemoteLocations(List<RemoteLocation> locations)
setDiscoverTargets
was set to
true
.locations
- List of remote locations.String createTarget(String url)
url
- The initial URL the page will be navigated to.void detachFromTarget()
void sendMessageToTarget(String message)
Copyright © 2017–2018 WebFolder OÜ. All rights reserved.