docs: small tweaks (#6681)

This commit is contained in:
Dmitry Gozman 2021-05-20 09:19:58 -07:00 committed by GitHub
parent 6281b95acc
commit 8490eb3c89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View file

@ -178,7 +178,7 @@ class Example
{ {
using var playwright = await Playwright.CreateAsync(); using var playwright = await Playwright.CreateAsync();
var chromium = playwright.Chromium; var chromium = playwright.Chromium;
// Can be "msedge", "chrome-beta", "msedge-beta", "msedge-dev", etc. // Make sure to run headed.
var browser = await chromium.LaunchAsync(new BrowserTypeLaunchOptions { Headless = false }); var browser = await chromium.LaunchAsync(new BrowserTypeLaunchOptions { Headless = false });
// Setup context however you like. // Setup context however you like.

View file

@ -65,31 +65,33 @@ a Playwright script in headed mode. Developer tools help to:
Using a [`method: Page.pause`] method is an easy way to pause the Playwright script execution Using a [`method: Page.pause`] method is an easy way to pause the Playwright script execution
and inspect the page in Developer tools. It will also open [Playwright Inspector](./inspector.md) to help with debugging. and inspect the page in Developer tools. It will also open [Playwright Inspector](./inspector.md) to help with debugging.
:::note
**For WebKit**: launching WebKit Inspector during the execution will
prevent the Playwright script from executing any further.
:::
:::note
**For Chromium**: you can also open developer tools through a launch option. **For Chromium**: you can also open developer tools through a launch option.
```js ```js
await chromium.launch({ devtools: true }); await chromium.launch({ devtools: true });
``` ```
```java ```java
chromium.launch(new BrowserType.LaunchOptions().setDevtools(true)); chromium.launch(new BrowserType.LaunchOptions().setDevtools(true));
``` ```
```python async ```python async
await chromium.launch(devtools=True) await chromium.launch(devtools=True)
``` ```
```python sync ```python sync
chromium.launch(devtools=True) chromium.launch(devtools=True)
``` ```
```csharp ```csharp
await using var browser = await playwright.Chromium.LaunchAsync(new BrowserTypeLaunchOptions await using var browser = await playwright.Chromium.LaunchAsync(new BrowserTypeLaunchOptions
{ {
Devtools: true Devtools: true
}); });
``` ```
:::note
**For WebKit**: launching WebKit Inspector during the execution will
prevent the Playwright script from executing any further.
::: :::
## Run in Debug Mode ## Run in Debug Mode