mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: update documentation (#7446)
Reference `page.setOfflineMode` and `page.emulateNetworkConditions` from each other.
This commit is contained in:
parent
5eb20e29a2
commit
18ed92bd08
@ -1706,7 +1706,8 @@ await page.evaluate(() => matchMedia('print').matches);
|
||||
- `latency` <[number]> Latency (ms), `0` to disable
|
||||
- returns: <[Promise]>
|
||||
|
||||
> **NOTE** This does not affect WebSockets and WebRTC PeerConnections (see https://crbug.com/563644)
|
||||
> **NOTE** This does not affect WebSockets and WebRTC PeerConnections (see https://crbug.com/563644). To set the page offline, you can use [page.setOfflineMode(enabled)](#pagesetofflinemodeenabled).
|
||||
|
||||
|
||||
```js
|
||||
const puppeteer = require('puppeteer');
|
||||
@ -2323,9 +2324,11 @@ await page.setGeolocation({ latitude: 59.95, longitude: 30.31667 });
|
||||
|
||||
#### page.setOfflineMode(enabled)
|
||||
|
||||
- `enabled` <[boolean]> When `true`, enables offline mode for the page.
|
||||
- `enabled` <[boolean]> When `true`, enables offline mode for the page.
|
||||
- returns: <[Promise]>
|
||||
|
||||
> **NOTE** while this method sets the network connection to offline, it does not change the parameters used in [page.emulateNetworkConditions(networkConditions)](#pageemulatenetworkconditionsnetworkconditions).
|
||||
|
||||
#### page.setRequestInterception(value)
|
||||
|
||||
- `value` <[boolean]> Whether to enable request interception.
|
||||
|
@ -854,6 +854,10 @@ export class Page extends EventEmitter {
|
||||
|
||||
/**
|
||||
* @param enabled - When `true`, enables offline mode for the page.
|
||||
* @remarks
|
||||
* NOTE: while this method sets the network connection to offline, it does
|
||||
* not change the parameters used in [page.emulateNetworkConditions(networkConditions)]
|
||||
* (#pageemulatenetworkconditionsnetworkconditions)
|
||||
*/
|
||||
setOfflineMode(enabled: boolean): Promise<void> {
|
||||
return this._frameManager.networkManager().setOfflineMode(enabled);
|
||||
@ -877,7 +881,8 @@ export class Page extends EventEmitter {
|
||||
* ```
|
||||
* @remarks
|
||||
* NOTE: This does not affect WebSockets and WebRTC PeerConnections (see
|
||||
* https://crbug.com/563644)
|
||||
* https://crbug.com/563644). To set the page offline, you can use
|
||||
* [page.setOfflineMode(enabled)](#pagesetofflinemodeenabled).
|
||||
*/
|
||||
emulateNetworkConditions(
|
||||
networkConditions: NetworkConditions | null
|
||||
|
Loading…
Reference in New Issue
Block a user