Skip to main content
Version: 23.8.0

Page.setUserAgent()方法

¥Page.setUserAgent() method

签名

¥Signature

class Page {
abstract setUserAgent(
userAgent: string,
userAgentMetadata?: Protocol.Emulation.UserAgentMetadata,
): Promise<void>;
}

参数

¥Parameters

范围

类型

描述

userAgent

string

此页面中使用的特定用户代理

userAgentMetadata

Protocol.Emulation.UserAgentMetadata

(可选的)

Returns:

Promise<void>

设置用户代理后解决的 Promise。

¥Promise which resolves when the user agent is set.