@@ -569,7 +569,7 @@ class Options extends Capabilities {
569
569
return extension . toString ( 'base64' )
570
570
}
571
571
return io
572
- . read ( /** @type {string } */ ( extension ) )
572
+ . read ( /** @type {string } */ ( extension ) )
573
573
. then ( ( buffer ) => buffer . toString ( 'base64' ) )
574
574
} )
575
575
}
@@ -622,7 +622,7 @@ class Driver extends webdriver.WebDriver {
622
622
* implementation.
623
623
* @override
624
624
*/
625
- setFileDetector ( ) { }
625
+ setFileDetector ( ) { }
626
626
627
627
/**
628
628
* Schedules a command to launch Chrome App with given ID.
@@ -791,7 +791,8 @@ class Driver extends webdriver.WebDriver {
791
791
response : 'ProvideCredentials' ,
792
792
username : username ,
793
793
password : password ,
794
- } } )
794
+ }
795
+ } )
795
796
} else if ( params . method === 'Fetch.requestPaused' ) {
796
797
const requestPausedParams = params [ 'params' ]
797
798
connection . execute ( 'Fetch.continueRequest' , this . getRandomNumber ( 1 , 10 ) , {
@@ -885,7 +886,14 @@ class Driver extends webdriver.WebDriver {
885
886
name : '__webdriver_attribute' ,
886
887
} , null )
887
888
888
- const mutationListener = fs . readFileSync ( '../../cdp-support/mutation-listener.js' , 'utf-8' ) . toString ( )
889
+ const mutationListener
890
+ try {
891
+ // Depending on what is running the code it could appear in 2 different places which is why we try
892
+ // here and then the other location
893
+ mutationListener = fs . readFileSync ( './javascript/node/selenium-webdriver/lib/atoms/mutation-listener.js' , 'utf-8' ) . toString ( )
894
+ } catch {
895
+ mutationListener = fs . readFileSync ( './lib/atoms/mutation-listener.js' , 'utf-8' ) . toString ( )
896
+ }
889
897
890
898
this . executeScript ( mutationListener )
891
899
@@ -897,7 +905,7 @@ class Driver extends webdriver.WebDriver {
897
905
const params = JSON . parse ( message )
898
906
if ( params . method === 'Runtime.bindingCalled' ) {
899
907
let payload = JSON . parse ( params [ 'params' ] [ 'payload' ] )
900
- let elements = await this . findElements ( { css : "*[data-__webdriver_id=" + payload [ 'target' ] } )
908
+ let elements = await this . findElements ( { css : "*[data-__webdriver_id=" + payload [ 'target' ] } )
901
909
902
910
if ( elements . length === 0 ) {
903
911
return
0 commit comments