Skip to main content
Version: 23.2.0

Page.setOfflineMode() 方法

¥Page.setOfflineMode() method

将网络连接设置为离线。

¥Sets the network connection to offline.

它不会改变 Page.emulateNetworkConditions() 中使用的参数

¥It does not change the parameters used in Page.emulateNetworkConditions()

签名

¥Signature

class Page {
abstract setOfflineMode(enabled: boolean): Promise<void>;
}

参数

¥Parameters

范围

类型

描述

enabled

boolean

true 时,启用页面的离线模式。

Returns:

Promise<void>