@@ -637,12 +637,12 @@ export class CdpTarget {
637637 }
638638
639639 if (
640- this . #userContextConfig. emulatedGeolocation !== undefined &&
641- this . #userContextConfig. emulatedGeolocation !== null
640+ this . #userContextConfig. geolocationOverride !== undefined &&
641+ this . #userContextConfig. geolocationOverride !== null
642642 ) {
643643 promises . push (
644644 this . setGeolocationOverride (
645- this . #userContextConfig. emulatedGeolocation ,
645+ this . #userContextConfig. geolocationOverride ,
646646 ) ,
647647 ) ;
648648 }
@@ -673,32 +673,32 @@ export class CdpTarget {
673673 }
674674
675675 async setGeolocationOverride (
676- coordinates :
676+ geolocationOverride :
677677 | Emulation . GeolocationCoordinates
678678 | Emulation . GeolocationPositionError
679679 | null ,
680680 ) : Promise < void > {
681- if ( coordinates === null ) {
681+ if ( geolocationOverride === null ) {
682682 await this . cdpClient . sendCommand ( 'Emulation.clearGeolocationOverride' ) ;
683- } else if ( 'type' in coordinates ) {
684- if ( coordinates . type !== 'positionUnavailable' ) {
683+ } else if ( 'type' in geolocationOverride ) {
684+ if ( geolocationOverride . type !== 'positionUnavailable' ) {
685685 // Unreachable.
686686 throw new UnknownErrorException (
687- `Unknown geolocation error ${ coordinates . type } ` ,
687+ `Unknown geolocation error ${ geolocationOverride . type } ` ,
688688 ) ;
689689 }
690690 // Omitting latitude, longitude or accuracy emulates position unavailable.
691691 await this . cdpClient . sendCommand ( 'Emulation.setGeolocationOverride' , { } ) ;
692- } else if ( 'latitude' in coordinates ) {
692+ } else if ( 'latitude' in geolocationOverride ) {
693693 await this . cdpClient . sendCommand ( 'Emulation.setGeolocationOverride' , {
694- latitude : coordinates . latitude ,
695- longitude : coordinates . longitude ,
696- accuracy : coordinates . accuracy ?? 1 ,
694+ latitude : geolocationOverride . latitude ,
695+ longitude : geolocationOverride . longitude ,
696+ accuracy : geolocationOverride . accuracy ?? 1 ,
697697 // `null` value is treated as "missing".
698- altitude : coordinates . altitude ?? undefined ,
699- altitudeAccuracy : coordinates . altitudeAccuracy ?? undefined ,
700- heading : coordinates . heading ?? undefined ,
701- speed : coordinates . speed ?? undefined ,
698+ altitude : geolocationOverride . altitude ?? undefined ,
699+ altitudeAccuracy : geolocationOverride . altitudeAccuracy ?? undefined ,
700+ heading : geolocationOverride . heading ?? undefined ,
701+ speed : geolocationOverride . speed ?? undefined ,
702702 } ) ;
703703 } else {
704704 // Unreachable.
0 commit comments