@@ -649,13 +649,13 @@ public async Task<Response> GoToAsync(string url, NavigationOptions options)
649649 var referrer = _networkManager . ExtraHTTPHeaders ? . GetValueOrDefault ( "referer" ) ;
650650 var requests = new Dictionary < string , Request > ( ) ;
651651
652- EventHandler < RequestEventArgs > createRequestEventListener = ( object sender , RequestEventArgs e ) =>
652+ void createRequestEventListener ( object sender , RequestEventArgs e )
653653 {
654654 if ( ! requests . ContainsKey ( e . Request . Url ) )
655655 {
656656 requests . Add ( e . Request . Url , e . Request ) ;
657657 }
658- } ;
658+ }
659659
660660 _networkManager . Request += createRequestEventListener ;
661661
@@ -1283,7 +1283,7 @@ public async Task<Response> WaitForNavigationAsync(NavigationOptions options = n
12831283 var watcher = new NavigatorWatcher ( _frameManager , mainFrame , timeout , options ) ;
12841284 var responses = new Dictionary < string , Response > ( ) ;
12851285
1286- EventHandler < ResponseCreatedEventArgs > createResponseEventListener = ( sender , e ) => responses [ e . Response . Url ] = e . Response ;
1286+ void createResponseEventListener ( object sender , ResponseCreatedEventArgs e ) => responses [ e . Response . Url ] = e . Response ;
12871287
12881288 _networkManager . Response += createResponseEventListener ;
12891289
@@ -1306,15 +1306,15 @@ public async Task<Response> WaitForNavigationAsync(NavigationOptions options = n
13061306 /// <returns>Task which which resolves to the main resource response. In case of multiple redirects,
13071307 /// the navigation will resolve with the response of the last redirect. If can not go back, resolves to null.</returns>
13081308 /// <param name="options">Navigation parameters.</param>
1309- public Task < Response > GoBackAsync ( NavigationOptions options = null ) => GoAsync ( - 1 , null ) ;
1309+ public Task < Response > GoBackAsync ( NavigationOptions options = null ) => GoAsync ( - 1 , options ) ;
13101310
13111311 /// <summary>
13121312 /// Navigate to the next page in history.
13131313 /// </summary>
13141314 /// <returns>Task which which resolves to the main resource response. In case of multiple redirects,
13151315 /// the navigation will resolve with the response of the last redirect. If can not go forward, resolves to null.</returns>
13161316 /// <param name="options">Navigation parameters.</param>
1317- public Task < Response > GoForwardAsync ( NavigationOptions options = null ) => GoAsync ( 1 , null ) ;
1317+ public Task < Response > GoForwardAsync ( NavigationOptions options = null ) => GoAsync ( 1 , options ) ;
13181318
13191319 #endregion
13201320
@@ -1402,7 +1402,7 @@ private async Task<byte[]> PerformScreenshot(string format, ScreenshotOptions op
14021402 targetId = Target . TargetId
14031403 } ) ;
14041404
1405- var clip = options . Clip != null ? options . Clip . Clone ( ) : null ;
1405+ var clip = options . Clip ? . Clone ( ) ;
14061406 if ( clip != null )
14071407 {
14081408 clip . Scale = 1 ;
@@ -1740,7 +1740,7 @@ private async Task Navigate(CDPSession client, string url, string referrer)
17401740
17411741 if ( response . errorText != null )
17421742 {
1743- throw new NavigationException ( response . errorText . ToString ( ) ) ;
1743+ throw new NavigationException ( response . errorText . ToString ( ) , url ) ;
17441744 }
17451745 }
17461746
0 commit comments