0
# Domain Management
1
2
Main entry point providing access to all Chrome DevTools Protocol domains through the v138Domains class. This central coordinator initializes and manages all CDP domain implementations for version 138.
3
4
## Capabilities
5
6
### Domains Factory
7
8
Creates and manages all CDP domain instances with proper DevTools integration.
9
10
```java { .api }
11
/**
12
* Main CDP domains aggregator providing access to all protocol domains
13
* @param devtools DevTools connection instance for CDP communication
14
*/
15
public class v138Domains implements Domains {
16
public v138Domains(DevTools devtools); // Validates devtools with Require.nonNull()
17
}
18
```
19
20
**Usage Example:**
21
22
```java
23
import org.openqa.selenium.chrome.ChromeDriver;
24
import org.openqa.selenium.devtools.DevTools;
25
import org.openqa.selenium.devtools.v138.v138Domains;
26
27
ChromeDriver driver = new ChromeDriver();
28
DevTools devTools = driver.getDevTools();
29
devTools.createSession();
30
31
// Create domains aggregator
32
v138Domains domains = new v138Domains(devTools);
33
34
// Now access individual domains
35
domains.events().enableRuntime();
36
domains.network().enableNetworkCaching();
37
```
38
39
### Events Domain Access
40
41
Provides access to runtime events and console handling capabilities.
42
43
```java { .api }
44
/**
45
* Access to runtime events and console handling
46
* @return Events domain implementation for v138
47
*/
48
@Override
49
public Events<?, ?> events();
50
```
51
52
### JavaScript Domain Access
53
54
Provides access to JavaScript execution and binding management.
55
56
```java { .api }
57
/**
58
* Access to JavaScript execution and binding capabilities
59
* @return Javascript domain implementation for v138
60
*/
61
@Override
62
public Javascript<?, ?> javascript();
63
```
64
65
### Network Domain Access
66
67
Provides access to network monitoring and interception capabilities.
68
69
```java { .api }
70
/**
71
* Access to network monitoring and interception
72
* @return Network domain implementation for v138
73
*/
74
@Override
75
public Network<?, ?> network();
76
```
77
78
### Target Domain Access
79
80
Provides access to target/tab management capabilities.
81
82
```java { .api }
83
/**
84
* Access to target/tab management
85
* @return Target domain implementation for v138
86
*/
87
@Override
88
public Target target();
89
```
90
91
### Log Domain Access
92
93
Provides access to console logging functionality.
94
95
```java { .api }
96
/**
97
* Access to console logging functionality
98
* @return Log domain implementation for v138
99
*/
100
@Override
101
public Log log();
102
```
103
104
## Implementation Details
105
106
The v138Domains class initializes domain instances in its constructor:
107
108
- **v138Events**: Initialized with DevTools connection for runtime event handling
109
- **v138Javascript**: Initialized with DevTools connection for script management
110
- **v138Log**: Initialized with default constructor (stateless)
111
- **v138Network**: Initialized with DevTools connection for network operations
112
- **v138Target**: Initialized with default constructor (stateless)
113
114
All domain instances are created eagerly during construction and maintained throughout the domains object lifecycle.