puppeteer/docs/api/puppeteer.page.setuseragent.md

65 lines
689 B
Markdown
Raw Normal View History

2022-07-05 13:41:43 +00:00
---
sidebar_label: Page.setUserAgent
---
# Page.setUserAgent() method
#### 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
<table><thead><tr><th>
2022-07-05 13:41:43 +00:00
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
userAgent
</td><td>
string
</td><td>
Specific user agent to use in this page
</td></tr>
<tr><td>
userAgentMetadata
</td><td>
Protocol.Emulation.UserAgentMetadata
</td><td>
_(Optional)_
</td></tr>
</tbody></table>
2022-07-05 13:41:43 +00:00
**Returns:**
Promise&lt;void&gt;
Promise which resolves when the user agent is set.