@@ -116,104 +116,104 @@ public Task<GetTreeResult> GetTreeAsync(BrowsingContextGetTreeOptions? options =
116116 return BiDi . BrowsingContext . GetTreeAsync ( getTreeOptions ) ;
117117 }
118118
119- public Task < Subscription > OnNavigationStartedAsync ( Func < NavigationInfo , Task > handler , SubscriptionOptions ? options = null )
119+ public Task < Subscription > OnNavigationStartedAsync ( Func < NavigationInfo , Task > handler , ContextSubscriptionOptions ? options = null )
120120 {
121- return BiDi . BrowsingContext . OnNavigationStartedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
121+ return BiDi . BrowsingContext . OnNavigationStartedAsync ( handler , options . WithContext ( this ) ) ;
122122 }
123123
124- public Task < Subscription > OnNavigationStartedAsync ( Action < NavigationInfo > handler , SubscriptionOptions ? options = null )
124+ public Task < Subscription > OnNavigationStartedAsync ( Action < NavigationInfo > handler , ContextSubscriptionOptions ? options = null )
125125 {
126- return BiDi . BrowsingContext . OnNavigationStartedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
126+ return BiDi . BrowsingContext . OnNavigationStartedAsync ( handler , options . WithContext ( this ) ) ;
127127 }
128128
129- public Task < Subscription > OnFragmentNavigatedAsync ( Func < NavigationInfo , Task > handler , SubscriptionOptions ? options = null )
129+ public Task < Subscription > OnFragmentNavigatedAsync ( Func < NavigationInfo , Task > handler , ContextSubscriptionOptions ? options = null )
130130 {
131- return BiDi . BrowsingContext . OnFragmentNavigatedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
131+ return BiDi . BrowsingContext . OnFragmentNavigatedAsync ( handler , options . WithContext ( this ) ) ;
132132 }
133133
134- public Task < Subscription > OnFragmentNavigatedAsync ( Action < NavigationInfo > handler , SubscriptionOptions ? options = null )
134+ public Task < Subscription > OnFragmentNavigatedAsync ( Action < NavigationInfo > handler , ContextSubscriptionOptions ? options = null )
135135 {
136- return BiDi . BrowsingContext . OnFragmentNavigatedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
136+ return BiDi . BrowsingContext . OnFragmentNavigatedAsync ( handler , options . WithContext ( this ) ) ;
137137 }
138138
139- public Task < Subscription > OnHistoryUpdatedAsync ( Func < HistoryUpdatedEventArgs , Task > handler , SubscriptionOptions ? options = null )
139+ public Task < Subscription > OnHistoryUpdatedAsync ( Func < HistoryUpdatedEventArgs , Task > handler , ContextSubscriptionOptions ? options = null )
140140 {
141- return BiDi . BrowsingContext . OnHistoryUpdatedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
141+ return BiDi . BrowsingContext . OnHistoryUpdatedAsync ( handler , options . WithContext ( this ) ) ;
142142 }
143143
144- public Task < Subscription > OnHistoryUpdatedAsync ( Action < HistoryUpdatedEventArgs > handler , SubscriptionOptions ? options = null )
144+ public Task < Subscription > OnHistoryUpdatedAsync ( Action < HistoryUpdatedEventArgs > handler , ContextSubscriptionOptions ? options = null )
145145 {
146- return BiDi . BrowsingContext . OnHistoryUpdatedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
146+ return BiDi . BrowsingContext . OnHistoryUpdatedAsync ( handler , options . WithContext ( this ) ) ;
147147 }
148148
149- public Task < Subscription > OnDomContentLoadedAsync ( Func < NavigationInfo , Task > handler , SubscriptionOptions ? options = null )
149+ public Task < Subscription > OnDomContentLoadedAsync ( Func < NavigationInfo , Task > handler , ContextSubscriptionOptions ? options = null )
150150 {
151- return BiDi . BrowsingContext . OnDomContentLoadedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
151+ return BiDi . BrowsingContext . OnDomContentLoadedAsync ( handler , options . WithContext ( this ) ) ;
152152 }
153153
154- public Task < Subscription > OnDomContentLoadedAsync ( Action < NavigationInfo > handler , SubscriptionOptions ? options = null )
154+ public Task < Subscription > OnDomContentLoadedAsync ( Action < NavigationInfo > handler , ContextSubscriptionOptions ? options = null )
155155 {
156- return BiDi . BrowsingContext . OnDomContentLoadedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
156+ return BiDi . BrowsingContext . OnDomContentLoadedAsync ( handler , options . WithContext ( this ) ) ;
157157 }
158158
159- public Task < Subscription > OnLoadAsync ( Action < NavigationInfo > handler , SubscriptionOptions ? options = null )
159+ public Task < Subscription > OnLoadAsync ( Action < NavigationInfo > handler , ContextSubscriptionOptions ? options = null )
160160 {
161- return BiDi . BrowsingContext . OnLoadAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
161+ return BiDi . BrowsingContext . OnLoadAsync ( handler , options . WithContext ( this ) ) ;
162162 }
163163
164- public Task < Subscription > OnLoadAsync ( Func < NavigationInfo , Task > handler , SubscriptionOptions ? options = null )
164+ public Task < Subscription > OnLoadAsync ( Func < NavigationInfo , Task > handler , ContextSubscriptionOptions ? options = null )
165165 {
166- return BiDi . BrowsingContext . OnLoadAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
166+ return BiDi . BrowsingContext . OnLoadAsync ( handler , options . WithContext ( this ) ) ;
167167 }
168168
169- public Task < Subscription > OnDownloadWillBeginAsync ( Action < DownloadWillBeginEventArgs > handler , SubscriptionOptions ? options = null )
169+ public Task < Subscription > OnDownloadWillBeginAsync ( Action < DownloadWillBeginEventArgs > handler , ContextSubscriptionOptions ? options = null )
170170 {
171- return BiDi . BrowsingContext . OnDownloadWillBeginAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
171+ return BiDi . BrowsingContext . OnDownloadWillBeginAsync ( handler , options . WithContext ( this ) ) ;
172172 }
173173
174- public Task < Subscription > OnDownloadWillBeginAsync ( Func < DownloadWillBeginEventArgs , Task > handler , SubscriptionOptions ? options = null )
174+ public Task < Subscription > OnDownloadWillBeginAsync ( Func < DownloadWillBeginEventArgs , Task > handler , ContextSubscriptionOptions ? options = null )
175175 {
176- return BiDi . BrowsingContext . OnDownloadWillBeginAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
176+ return BiDi . BrowsingContext . OnDownloadWillBeginAsync ( handler , options . WithContext ( this ) ) ;
177177 }
178178
179- public Task < Subscription > OnDownloadEndAsync ( Action < DownloadEndEventArgs > handler , SubscriptionOptions ? options = null )
179+ public Task < Subscription > OnDownloadEndAsync ( Action < DownloadEndEventArgs > handler , ContextSubscriptionOptions ? options = null )
180180 {
181- return BiDi . BrowsingContext . OnDownloadEndAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
181+ return BiDi . BrowsingContext . OnDownloadEndAsync ( handler , options . WithContext ( this ) ) ;
182182 }
183183
184- public Task < Subscription > OnDownloadEndAsync ( Func < DownloadEndEventArgs , Task > handler , SubscriptionOptions ? options = null )
184+ public Task < Subscription > OnDownloadEndAsync ( Func < DownloadEndEventArgs , Task > handler , ContextSubscriptionOptions ? options = null )
185185 {
186- return BiDi . BrowsingContext . OnDownloadEndAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
186+ return BiDi . BrowsingContext . OnDownloadEndAsync ( handler , options . WithContext ( this ) ) ;
187187 }
188188
189- public Task < Subscription > OnNavigationAbortedAsync ( Action < NavigationInfo > handler , SubscriptionOptions ? options = null )
189+ public Task < Subscription > OnNavigationAbortedAsync ( Action < NavigationInfo > handler , ContextSubscriptionOptions ? options = null )
190190 {
191- return BiDi . BrowsingContext . OnNavigationAbortedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
191+ return BiDi . BrowsingContext . OnNavigationAbortedAsync ( handler , options . WithContext ( this ) ) ;
192192 }
193193
194- public Task < Subscription > OnNavigationAbortedAsync ( Func < NavigationInfo , Task > handler , SubscriptionOptions ? options = null )
194+ public Task < Subscription > OnNavigationAbortedAsync ( Func < NavigationInfo , Task > handler , ContextSubscriptionOptions ? options = null )
195195 {
196- return BiDi . BrowsingContext . OnNavigationAbortedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
196+ return BiDi . BrowsingContext . OnNavigationAbortedAsync ( handler , options . WithContext ( this ) ) ;
197197 }
198198
199- public Task < Subscription > OnNavigationFailedAsync ( Action < NavigationInfo > handler , SubscriptionOptions ? options = null )
199+ public Task < Subscription > OnNavigationFailedAsync ( Action < NavigationInfo > handler , ContextSubscriptionOptions ? options = null )
200200 {
201- return BiDi . BrowsingContext . OnNavigationFailedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
201+ return BiDi . BrowsingContext . OnNavigationFailedAsync ( handler , options . WithContext ( this ) ) ;
202202 }
203203
204- public Task < Subscription > OnNavigationFailedAsync ( Func < NavigationInfo , Task > handler , SubscriptionOptions ? options = null )
204+ public Task < Subscription > OnNavigationFailedAsync ( Func < NavigationInfo , Task > handler , ContextSubscriptionOptions ? options = null )
205205 {
206- return BiDi . BrowsingContext . OnNavigationFailedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
206+ return BiDi . BrowsingContext . OnNavigationFailedAsync ( handler , options . WithContext ( this ) ) ;
207207 }
208208
209- public Task < Subscription > OnNavigationCommittedAsync ( Action < NavigationInfo > handler , SubscriptionOptions ? options = null )
209+ public Task < Subscription > OnNavigationCommittedAsync ( Action < NavigationInfo > handler , ContextSubscriptionOptions ? options = null )
210210 {
211- return BiDi . BrowsingContext . OnNavigationCommittedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
211+ return BiDi . BrowsingContext . OnNavigationCommittedAsync ( handler , options . WithContext ( this ) ) ;
212212 }
213213
214- public Task < Subscription > OnNavigationCommittedAsync ( Func < NavigationInfo , Task > handler , SubscriptionOptions ? options = null )
214+ public Task < Subscription > OnNavigationCommittedAsync ( Func < NavigationInfo , Task > handler , ContextSubscriptionOptions ? options = null )
215215 {
216- return BiDi . BrowsingContext . OnNavigationCommittedAsync ( handler , new BrowsingContextsSubscriptionOptions ( options ) { Contexts = [ this ] } ) ;
216+ return BiDi . BrowsingContext . OnNavigationCommittedAsync ( handler , options . WithContext ( this ) ) ;
217217 }
218218
219219 public override bool Equals ( object ? obj )
0 commit comments