public interface Target
Modifier and Type | Method and 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 setDiscoverTargets(Boolean discover)
discover
- Whether to discover available targets.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 setAttachToFrames(Boolean value)
void setRemoteLocations(List<RemoteLocation> locations)
locations
- List of remote locations.void sendMessageToTarget(String message, String sessionId, String targetId)
sessionId
- Identifier of the session.targetId
- Deprecated.TargetInfo getTargetInfo(String targetId)
void activateTarget(String targetId)
Boolean closeTarget(String targetId)
String attachToTarget(String targetId)
void detachFromTarget(String sessionId, String targetId)
sessionId
- Session to detach.targetId
- Deprecated.String createBrowserContext()
Boolean disposeBrowserContext(String browserContextId)
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).List<TargetInfo> getTargets()
void sendMessageToTarget(String message)
void detachFromTarget()
Copyright © 2017 WebFolder OÜ. All rights reserved.