Skip to content

Commit 2f8ccf0

Browse files
committed
Remove random movement from Playwright because it doesn't work
1 parent 5b5aadf commit 2f8ccf0

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

pyppeteer_ghost_cursor/playwright/async_api/_spoof.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,11 @@ async def move_to(self, destination: dict):
159159
self.toggle_random_move(True)
160160

161161

162-
def create_cursor(
163-
page, start: Union[Vector, Dict] = origin, perform_random_moves: bool = False
164-
) -> GhostCursor:
162+
def create_cursor(page, start: Union[Vector, Dict] = origin) -> GhostCursor:
165163
if isinstance(start, dict):
166164
start = Vector(**start)
167165
cursor = GhostCursor(page, start)
168-
if perform_random_moves:
169-
asyncio.ensure_future(cursor.random_move()) # fire and forget
166+
# Can't seem to get random movement to work with Playwright.
167+
# if perform_random_moves:
168+
# asyncio.ensure_future(cursor.random_move()) # fire and forget
170169
return cursor

pyppeteer_ghost_cursor/playwright/sync_api/_spoof.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def create_cursor(page, start: Union[Vector, Dict] = origin) -> GhostCursor:
160160
if isinstance(start, dict):
161161
start = Vector(**start)
162162
cursor = GhostCursor(page, start)
163-
# TODO: Make this work with the sync API
163+
# Can't seem to get random movement to work with Playwright.
164164
# if perform_random_moves:
165-
# asyncio.ensure_future(cursor.random_move()) # fire and forget
165+
# asyncio.ensure_future(cursor.random_move()) # fire and forget
166166
return cursor

0 commit comments

Comments
 (0)