@@ -47,7 +47,8 @@ function executionLoop() {
4747 PlaybackState . setCommandState ( id , PlaybackStates . Pending ) ;
4848 if ( isExtCommand ( command ) ) {
4949 let upperCase = command . charAt ( 0 ) . toUpperCase ( ) + command . slice ( 1 ) ;
50- return ( extCommand [ "do" + upperCase ] ( target , value ) )
50+ const parsedTarget = command === "open" ? new URL ( target , baseUrl ) . href : target ;
51+ return ( extCommand [ "do" + upperCase ] ( parsedTarget , value ) )
5152 . then ( ( ) => {
5253 PlaybackState . setCommandState ( id , PlaybackStates . Passed ) ;
5354 return executionLoop ( ) ;
@@ -212,9 +213,8 @@ function doCommand(res, implicitTime = Date.now(), implicitCount = 0) {
212213 } , 500 ) ;
213214 } ) ;
214215
215- const parsedTarget = command === "open" ? new URL ( target , baseUrl ) . href : target ;
216216 return p . then ( ( ) => (
217- extCommand . sendMessage ( command , xlateArgument ( parsedTarget ) , xlateArgument ( value ) , isWindowMethodCommand ( command ) )
217+ extCommand . sendMessage ( command , xlateArgument ( target ) , xlateArgument ( value ) , isWindowMethodCommand ( command ) )
218218 ) )
219219 . then ( function ( result ) {
220220 if ( result . result !== "success" ) {
@@ -229,7 +229,7 @@ function doCommand(res, implicitTime = Date.now(), implicitCount = 0) {
229229 if ( implicitCount == 1 ) {
230230 implicitTime = Date . now ( ) ;
231231 }
232- PlaybackState . setCommandState ( id , PlaybackStates . Pending , `Trying to find ${ parsedTarget } ...` ) ;
232+ PlaybackState . setCommandState ( id , PlaybackStates . Pending , `Trying to find ${ target } ...` ) ;
233233 return doCommand ( false , implicitTime , implicitCount ) ;
234234 }
235235 }
0 commit comments