mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
docs(new): migrate Page.ts to TSDoc (part 0 / 2) (#6104)
* docs(new): migrate Page.ts to TSDoc (part 0 / 2) Co-authored-by: Changhao Han <changhaohan@chromium.org>
This commit is contained in:
@@ -4,23 +4,33 @@
|
||||
|
||||
## Page.setGeolocation() method
|
||||
|
||||
Sets the page's geolocation.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
setGeolocation(options: {
|
||||
longitude: number;
|
||||
latitude: number;
|
||||
accuracy?: number;
|
||||
}): Promise<void>;
|
||||
setGeolocation(options: GeolocationOptions): Promise<void>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| options | { longitude: number; latitude: number; accuracy?: number; } | |
|
||||
| options | [GeolocationOptions](./puppeteer.geolocationoptions.md) | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
Promise<void>
|
||||
|
||||
## Remarks
|
||||
|
||||
Consider using [BrowserContext.overridePermissions()](./puppeteer.browsercontext.overridepermissions.md) to grant permissions for the page to read its geolocation.
|
||||
|
||||
## Example
|
||||
|
||||
|
||||
```js
|
||||
await page.setGeolocation({latitude: 59.95, longitude: 30.31667});
|
||||
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user