Skip to content

Commit

Permalink
feat: getLocation
Browse files Browse the repository at this point in the history
  • Loading branch information
bvandercar-vt committed May 9, 2024
1 parent d829e31 commit d1c87c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ Moves the mouse to the specified destination point.

- **destination:** An object with `x` and `y` coordinates representing the target position. For example, `{ x: 500, y: 300 }`.

#### `getLocation(): Vector`

Get current location of the cursor.

### Other Utility Methods

#### `installMouseHelper(page: Page): Promise<void>`
Expand Down
5 changes: 5 additions & 0 deletions src/spoof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export interface GhostCursor {
options?: MoveOptions
) => Promise<void>
moveTo: (destination: Vector) => Promise<void>
getLocation: () => Vector
}

// Helper function to wait a specified number of milliseconds
Expand Down Expand Up @@ -347,6 +348,10 @@ export const createCursor = (
moving = !random
},

getLocation():Vector{
return previous
},

async click (
selector?: string | ElementHandle,
options?: ClickOptions
Expand Down

0 comments on commit d1c87c4

Please sign in to comment.