@@ -8,18 +8,16 @@ public class BrowsingContext
8
8
{
9
9
internal BrowsingContext ( BiDi bidi , string id )
10
10
{
11
- _bidi = bidi ;
11
+ BiDi = bidi ;
12
12
Id = id ;
13
13
14
- _logModule = new Lazy < BrowsingContextLogModule > ( ( ) => new BrowsingContextLogModule ( this , _bidi . Log ) ) ;
15
- _networkModule = new Lazy < BrowsingContextNetworkModule > ( ( ) => new BrowsingContextNetworkModule ( this , _bidi . Network ) ) ;
16
- _scriptModule = new Lazy < BrowsingContextScriptModule > ( ( ) => new BrowsingContextScriptModule ( this , _bidi . ScriptModule ) ) ;
17
- _storageModule = new Lazy < BrowsingContextStorageModule > ( ( ) => new BrowsingContextStorageModule ( this , _bidi . Storage ) ) ;
18
- _inputModule = new Lazy < BrowsingContextInputModule > ( ( ) => new BrowsingContextInputModule ( this , _bidi . InputModule ) ) ;
14
+ _logModule = new Lazy < BrowsingContextLogModule > ( ( ) => new BrowsingContextLogModule ( this , BiDi . Log ) ) ;
15
+ _networkModule = new Lazy < BrowsingContextNetworkModule > ( ( ) => new BrowsingContextNetworkModule ( this , BiDi . Network ) ) ;
16
+ _scriptModule = new Lazy < BrowsingContextScriptModule > ( ( ) => new BrowsingContextScriptModule ( this , BiDi . ScriptModule ) ) ;
17
+ _storageModule = new Lazy < BrowsingContextStorageModule > ( ( ) => new BrowsingContextStorageModule ( this , BiDi . Storage ) ) ;
18
+ _inputModule = new Lazy < BrowsingContextInputModule > ( ( ) => new BrowsingContextInputModule ( this , BiDi . InputModule ) ) ;
19
19
}
20
20
21
- private readonly BiDi _bidi ;
22
-
23
21
private readonly Lazy < BrowsingContextLogModule > _logModule ;
24
22
private readonly Lazy < BrowsingContextNetworkModule > _networkModule ;
25
23
private readonly Lazy < BrowsingContextScriptModule > _scriptModule ;
@@ -28,6 +26,8 @@ internal BrowsingContext(BiDi bidi, string id)
28
26
29
27
internal string Id { get ; }
30
28
29
+ public BiDi BiDi { get ; }
30
+
31
31
public BrowsingContextLogModule Log => _logModule . Value ;
32
32
33
33
public BrowsingContextNetworkModule Network => _networkModule . Value ;
@@ -40,37 +40,37 @@ internal BrowsingContext(BiDi bidi, string id)
40
40
41
41
public Task < NavigateResult > NavigateAsync ( string url , NavigateOptions ? options = null )
42
42
{
43
- return _bidi . BrowsingContextModule . NavigateAsync ( this , url , options ) ;
43
+ return BiDi . BrowsingContextModule . NavigateAsync ( this , url , options ) ;
44
44
}
45
45
46
46
public Task < NavigateResult > ReloadAsync ( ReloadOptions ? options = null )
47
47
{
48
- return _bidi . BrowsingContextModule . ReloadAsync ( this , options ) ;
48
+ return BiDi . BrowsingContextModule . ReloadAsync ( this , options ) ;
49
49
}
50
50
51
51
public Task ActivateAsync ( ActivateOptions ? options = null )
52
52
{
53
- return _bidi . BrowsingContextModule . ActivateAsync ( this , options ) ;
53
+ return BiDi . BrowsingContextModule . ActivateAsync ( this , options ) ;
54
54
}
55
55
56
56
public Task < IReadOnlyList < Script . NodeRemoteValue > > LocateNodesAsync ( Locator locator , LocateNodesOptions ? options = null )
57
57
{
58
- return _bidi . BrowsingContextModule . LocateNodesAsync ( this , locator , options ) ;
58
+ return BiDi . BrowsingContextModule . LocateNodesAsync ( this , locator , options ) ;
59
59
}
60
60
61
61
public Task < CaptureScreenshotResult > CaptureScreenshotAsync ( CaptureScreenshotOptions ? options = null )
62
62
{
63
- return _bidi . BrowsingContextModule . CaptureScreenshotAsync ( this , options ) ;
63
+ return BiDi . BrowsingContextModule . CaptureScreenshotAsync ( this , options ) ;
64
64
}
65
65
66
66
public Task CloseAsync ( CloseOptions ? options = null )
67
67
{
68
- return _bidi . BrowsingContextModule . CloseAsync ( this , options ) ;
68
+ return BiDi . BrowsingContextModule . CloseAsync ( this , options ) ;
69
69
}
70
70
71
71
public Task TraverseHistoryAsync ( int delta , TraverseHistoryOptions ? options = null )
72
72
{
73
- return _bidi . BrowsingContextModule . TraverseHistoryAsync ( this , delta , options ) ;
73
+ return BiDi . BrowsingContextModule . TraverseHistoryAsync ( this , delta , options ) ;
74
74
}
75
75
76
76
public Task NavigateBackAsync ( TraverseHistoryOptions ? options = null )
@@ -85,17 +85,17 @@ public Task NavigateForwardAsync(TraverseHistoryOptions? options = null)
85
85
86
86
public Task SetViewportAsync ( SetViewportOptions ? options = null )
87
87
{
88
- return _bidi . BrowsingContextModule . SetViewportAsync ( this , options ) ;
88
+ return BiDi . BrowsingContextModule . SetViewportAsync ( this , options ) ;
89
89
}
90
90
91
91
public Task < PrintResult > PrintAsync ( PrintOptions ? options = null )
92
92
{
93
- return _bidi . BrowsingContextModule . PrintAsync ( this , options ) ;
93
+ return BiDi . BrowsingContextModule . PrintAsync ( this , options ) ;
94
94
}
95
95
96
96
public Task HandleUserPromptAsync ( HandleUserPromptOptions ? options = null )
97
97
{
98
- return _bidi . BrowsingContextModule . HandleUserPromptAsync ( this , options ) ;
98
+ return BiDi . BrowsingContextModule . HandleUserPromptAsync ( this , options ) ;
99
99
}
100
100
101
101
public Task < IReadOnlyList < BrowsingContextInfo > > GetTreeAsync ( BrowsingContextGetTreeOptions ? options = null )
@@ -105,77 +105,77 @@ public Task<IReadOnlyList<BrowsingContextInfo>> GetTreeAsync(BrowsingContextGetT
105
105
Root = this
106
106
} ;
107
107
108
- return _bidi . BrowsingContextModule . GetTreeAsync ( getTreeOptions ) ;
108
+ return BiDi . BrowsingContextModule . GetTreeAsync ( getTreeOptions ) ;
109
109
}
110
110
111
111
public Task < Subscription > OnNavigationStartedAsync ( Func < NavigationInfo , Task > handler , SubscriptionOptions ? options = null )
112
112
{
113
- return _bidi . BrowsingContextModule . OnNavigationStartedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
113
+ return BiDi . BrowsingContextModule . OnNavigationStartedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
114
114
}
115
115
116
116
public Task < Subscription > OnNavigationStartedAsync ( Action < NavigationInfo > handler , SubscriptionOptions ? options = null )
117
117
{
118
- return _bidi . BrowsingContextModule . OnNavigationStartedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
118
+ return BiDi . BrowsingContextModule . OnNavigationStartedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
119
119
}
120
120
121
121
public Task < Subscription > OnFragmentNavigatedAsync ( Func < NavigationInfo , Task > handler , SubscriptionOptions ? options = null )
122
122
{
123
- return _bidi . BrowsingContextModule . OnFragmentNavigatedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
123
+ return BiDi . BrowsingContextModule . OnFragmentNavigatedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
124
124
}
125
125
126
126
public Task < Subscription > OnFragmentNavigatedAsync ( Action < NavigationInfo > handler , SubscriptionOptions ? options = null )
127
127
{
128
- return _bidi . BrowsingContextModule . OnFragmentNavigatedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
128
+ return BiDi . BrowsingContextModule . OnFragmentNavigatedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
129
129
}
130
130
131
131
public Task < Subscription > OnDomContentLoadedAsync ( Func < NavigationInfo , Task > handler , SubscriptionOptions ? options = null )
132
132
{
133
- return _bidi . BrowsingContextModule . OnDomContentLoadedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
133
+ return BiDi . BrowsingContextModule . OnDomContentLoadedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
134
134
}
135
135
136
136
public Task < Subscription > OnLoadAsync ( Action < NavigationInfo > handler , SubscriptionOptions ? options = null )
137
137
{
138
- return _bidi . BrowsingContextModule . OnLoadAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
138
+ return BiDi . BrowsingContextModule . OnLoadAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
139
139
}
140
140
141
141
public Task < Subscription > OnLoadAsync ( Func < NavigationInfo , Task > handler , SubscriptionOptions ? options = null )
142
142
{
143
- return _bidi . BrowsingContextModule . OnLoadAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
143
+ return BiDi . BrowsingContextModule . OnLoadAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
144
144
}
145
145
146
146
public Task < Subscription > OnDownloadWillBeginAsync ( Action < NavigationInfo > handler , SubscriptionOptions ? options = null )
147
147
{
148
- return _bidi . BrowsingContextModule . OnDownloadWillBeginAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
148
+ return BiDi . BrowsingContextModule . OnDownloadWillBeginAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
149
149
}
150
150
151
151
public Task < Subscription > OnDownloadWillBeginAsync ( Func < NavigationInfo , Task > handler , SubscriptionOptions ? options = null )
152
152
{
153
- return _bidi . BrowsingContextModule . OnDownloadWillBeginAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
153
+ return BiDi . BrowsingContextModule . OnDownloadWillBeginAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
154
154
}
155
155
156
156
public Task < Subscription > OnNavigationAbortedAsync ( Action < NavigationInfo > handler , SubscriptionOptions ? options = null )
157
157
{
158
- return _bidi . BrowsingContextModule . OnNavigationAbortedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
158
+ return BiDi . BrowsingContextModule . OnNavigationAbortedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
159
159
}
160
160
161
161
public Task < Subscription > OnNavigationAbortedAsync ( Func < NavigationInfo , Task > handler , SubscriptionOptions ? options = null )
162
162
{
163
- return _bidi . BrowsingContextModule . OnNavigationAbortedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
163
+ return BiDi . BrowsingContextModule . OnNavigationAbortedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
164
164
}
165
165
166
166
public Task < Subscription > OnNavigationFailedAsync ( Action < NavigationInfo > handler , SubscriptionOptions ? options = null )
167
167
{
168
- return _bidi . BrowsingContextModule . OnNavigationFailedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
168
+ return BiDi . BrowsingContextModule . OnNavigationFailedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
169
169
}
170
170
171
171
public Task < Subscription > OnNavigationFailedAsync ( Func < NavigationInfo , Task > handler , SubscriptionOptions ? options = null )
172
172
{
173
- return _bidi . BrowsingContextModule . OnNavigationFailedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
173
+ return BiDi . BrowsingContextModule . OnNavigationFailedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
174
174
}
175
175
176
176
public Task < Subscription > OnDomContentLoadedAsync ( Action < NavigationInfo > handler , SubscriptionOptions ? options = null )
177
177
{
178
- return _bidi . BrowsingContextModule . OnDomContentLoadedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
178
+ return BiDi . BrowsingContextModule . OnDomContentLoadedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
179
179
}
180
180
181
181
public override bool Equals ( object ? obj )
0 commit comments