File tree Expand file tree Collapse file tree
javascript/node/selenium-webdriver/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,14 +89,20 @@ function driverLocation(options) {
8989 args . push ( '--browser-path' , '"' + vendorOptions . binary + '"' )
9090 }
9191
92- // Get the httpProxy and sslProxy values from the options object
93- const httpProxy = options . getProxy ( ) [ 'httpProxy' ] ;
94- const sslProxy = options . getProxy ( ) [ 'sslProxy' ] ;
95-
96- if ( httpProxy ) {
97- args . push ( '--proxy' , httpProxy ) ;
98- } else if ( sslProxy ) {
99- args . push ( '--proxy' , sslProxy ) ;
92+ const proxyOptions = options . getProxy ( ) ;
93+
94+ // Check if proxyOptions exists and has properties
95+ if ( proxyOptions && Object . keys ( proxyOptions ) . length > 0 ) {
96+ const httpProxy = proxyOptions [ 'httpProxy' ] ;
97+ const sslProxy = proxyOptions [ 'sslProxy' ] ;
98+
99+ if ( httpProxy !== undefined ) {
100+ args . push ( '--proxy' , httpProxy ) ;
101+ }
102+
103+ else if ( sslProxy !== undefined ) {
104+ args . push ( '--proxy' , sslProxy ) ;
105+ }
100106 }
101107
102108 const smBinary = getBinary ( )
You can’t perform that action at this time.
0 commit comments