puppeteer/website/versioned_docs/version-22.10.0/api/puppeteer.page.setofflinemode.md

51 lines
629 B
Markdown
Raw Normal View History

---
sidebar_label: Page.setOfflineMode
---
# Page.setOfflineMode() method
2022-10-14 12:54:46 +00:00
Sets the network connection to offline.
It does not change the parameters used in [Page.emulateNetworkConditions()](./puppeteer.page.emulatenetworkconditions.md)
2022-10-24 14:31:12 +00:00
#### Signature:
```typescript
class Page {
abstract setOfflineMode(enabled: boolean): Promise<void>;
}
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
enabled
</td><td>
boolean
</td><td>
When `true`, enables offline mode for the page.
</td></tr>
</tbody></table>
**Returns:**
Promise&lt;void&gt;