From 46165cf223c4d64f8240796cd0cbe98ea511d298 Mon Sep 17 00:00:00 2001 From: Snow Wang <31466760+why2lyj@users.noreply.github.com> Date: Thu, 9 Feb 2023 08:02:41 +0000 Subject: [PATCH] add set_geolocation_override add set_geolocation_override funtion --- ichrome/async_utils.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ichrome/async_utils.py b/ichrome/async_utils.py index e577a2e..5cd9968 100644 --- a/ichrome/async_utils.py +++ b/ichrome/async_utils.py @@ -2541,6 +2541,21 @@ async def browser_version(self, timeout=NotSet): "[Browser.getVersion]" return await self.send('Browser.getVersion', timeout=timeout) + async def set_geolocation_override(self, + latitude: Optional[int] = None, + longitude: Optional[int] = None, + accuracy: Optional[int] = None, + timeout=NotSet): + logger.debug(f'[set_geolocation_override] {self!r} latitude => {latitude}') + logger.debug(f'[set_geolocation_override] {self!r} longitude => {longitude}') + logger.debug(f'[set_geolocation_override] {self!r} accuracy => {accuracy}') + data = await self.send('Emulation.setGeolocationOverride', + latitude=latitude, + longitude=longitude, + accuracy=accuracy, + timeout=timeout) + return data + class OffsetMoveWalker: __slots__ = ('path', 'start_x', 'start_y', 'tab', 'timeout')