emulateNetworkConditionsByRule

Activates emulation of network conditions for individual requests using URL match patterns. Unlike the deprecated Network.emulateNetworkConditions this method does not affect navigator state. Use Network.overrideNetworkState to explicitly modify navigator behavior.


suspend fun emulateNetworkConditionsByRule(offline: Boolean? = null, emulateOfflineServiceWorker: Boolean? = null, matchedNetworkConditions: List<Network.NetworkConditions>): Network.EmulateNetworkConditionsByRuleReturn

Activates emulation of network conditions for individual requests using URL match patterns. Unlike the deprecated Network.emulateNetworkConditions this method does not affect navigator state. Use Network.overrideNetworkState to explicitly modify navigator behavior.

Parameters

offline

True to emulate internet disconnection. Deprecated, use the offline property in matchedNetworkConditions or emulateOfflineServiceWorker instead.

emulateOfflineServiceWorker

True to emulate offline service worker.

matchedNetworkConditions

Configure conditions for matching requests. If multiple entries match a request, the first entry wins. Global conditions can be configured by leaving the urlPattern for the conditions empty. These global conditions are also applied for throttling of p2p connections.