public class CdpCDPSession extends CDPSession
protocol methods can be called with session.send method. protocol events can be subscribed to with session.on method. Useful links:
Documentation on DevTools Protocol can be found here: DevTools Protocol Viewer. Getting Started with : DevTools Protocol
| 构造器和说明 |
|---|
CdpCDPSession(CdpConnection connection,
String targetType,
String sessionId,
String parentSessionId) |
| 限定符和类型 | 方法和说明 |
|---|---|
Connection |
connection()
The underlying connection for this session, if any.
|
void |
detach()
页面分离浏览器
|
boolean |
detached()
True if the session has been detached, false otherwise.
|
CdpTarget |
getTarget() |
String |
id() |
void |
onClosed() |
void |
onMessage(com.fasterxml.jackson.databind.JsonNode response,
CallbackRegistry callbacks)
receivedNode的结构
{
id?
|
CDPSession |
parentSession() |
com.fasterxml.jackson.databind.JsonNode |
send(String method) |
com.fasterxml.jackson.databind.JsonNode |
send(String method,
Map<String,Object> params) |
com.fasterxml.jackson.databind.JsonNode |
send(String method,
Object params,
Integer timeout,
boolean isBlocking) |
void |
setTarget(CdpTarget target) |
senddisposeSymbol, emit, listenerCount, off, on, once, removeAllListeners, removeListenerpublic CdpCDPSession(CdpConnection connection, String targetType, String sessionId, String parentSessionId)
public CDPSession parentSession()
parentSession 在类中 CDPSessionpublic void setTarget(CdpTarget target)
public void onClosed()
onClosed 在类中 CDPSessionpublic com.fasterxml.jackson.databind.JsonNode send(String method)
send 在类中 CDPSessionpublic com.fasterxml.jackson.databind.JsonNode send(String method, Object params, Integer timeout, boolean isBlocking)
send 在类中 CDPSessionpublic void detach()
detach 在类中 CDPSessionpublic void onMessage(com.fasterxml.jackson.databind.JsonNode response,
CallbackRegistry callbacks)
{
id?: number;
method: keyof CDPEvents;
params: CDPEvents[keyof CDPEvents];
error: {message: string; data: any; code: number};
result?: any;
}
response - 接受到的返回值callbacks - 回调public Connection connection()
CDPSessionconnection 在类中 CDPSessionpublic boolean detached()
CDPSessiondetached 在类中 CDPSessionpublic String id()
id 在类中 CDPSessionpublic CdpTarget getTarget()
Copyright © 2020–2025. All rights reserved.