public interface Target
Modifier and Type | Method and Description |
---|---|
void |
activateTarget(String targetId)
Activates (focuses) the target.
|
Boolean |
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)
Creates a new page.
|
void |
detachFromTarget(String targetId)
Detaches from the target 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 targetId,
String message)
Sends protocol message to the target 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/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 targetId, String message)
TargetInfo getTargetInfo(String targetId)
void activateTarget(String targetId)
Boolean closeTarget(String targetId)
Boolean attachToTarget(String targetId)
void detachFromTarget(String targetId)
String createBrowserContext()
Boolean disposeBrowserContext(String browserContextId)
String createTarget(String url, Integer width, Integer height, String browserContextId)
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).List<TargetInfo> getTargets()
Copyright © 2017 WebFolder OÜ. All rights reserved.