2022-07-05 13:41:43 +00:00
|
|
|
---
|
|
|
|
sidebar_label: Page.setUserAgent
|
|
|
|
---
|
|
|
|
|
|
|
|
# Page.setUserAgent() method
|
|
|
|
|
2022-10-24 07:07:05 +00:00
|
|
|
#### Signature:
|
2022-07-05 13:41:43 +00:00
|
|
|
|
|
|
|
```typescript
|
|
|
|
class Page {
|
2023-09-20 12:52:43 +00:00
|
|
|
abstract setUserAgent(
|
2022-07-05 13:41:43 +00:00
|
|
|
userAgent: string,
|
|
|
|
userAgentMetadata?: Protocol.Emulation.UserAgentMetadata
|
|
|
|
): Promise<void>;
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
|
| ----------------- | ------------------------------------ | --------------------------------------- |
|
|
|
|
| userAgent | string | Specific user agent to use in this page |
|
2023-02-23 12:31:23 +00:00
|
|
|
| userAgentMetadata | Protocol.Emulation.UserAgentMetadata | _(Optional)_ |
|
2022-07-05 13:41:43 +00:00
|
|
|
|
|
|
|
**Returns:**
|
|
|
|
|
|
|
|
Promise<void>
|
|
|
|
|
|
|
|
Promise which resolves when the user agent is set.
|