docs(dotnet): Improve some dotnet docs (#9265)

Co-authored-by: Max Schmitt <max@schmitt.mx>
This commit is contained in:
Darío Kondratiuk 2021-10-06 16:07:31 -03:00 committed by GitHub
parent 083d882b2b
commit ddbd64e4df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 7 deletions

View File

@ -6,7 +6,7 @@ BrowserContexts provide a way to operate multiple independent browser sessions.
If a page opens another page, e.g. with a `window.open` call, the popup will belong to the parent page's browser If a page opens another page, e.g. with a `window.open` call, the popup will belong to the parent page's browser
context. context.
Playwright allows creation of "incognito" browser contexts with `browser.newContext()` method. "Incognito" browser Playwright allows creating "incognito" browser contexts with [`method: Browser.newContext`] method. "Incognito" browser
contexts don't write any browsing data to disk. contexts don't write any browsing data to disk.
```js ```js

View File

@ -183,7 +183,7 @@ assert html == "<p>Result</p>"
```csharp ```csharp
var html = await page.InnerHTMLAsync("div.result"); var html = await page.InnerHTMLAsync("div.result");
Assert.Equals(html, "<p>Result</p>"); Assert.Equals("<p>Result</p>", html);
``` ```
### API reference ### API reference

View File

@ -594,7 +594,7 @@ page.click('#free-month-promo >> text=Sign Up')
```csharp ```csharp
// Click an element with text "Sign Up" inside of a #free-month-promo. // Click an element with text "Sign Up" inside of a #free-month-promo.
await page.Click("#free-month-promo >> text=Sign Up"); await page.ClickAsync("#free-month-promo >> text=Sign Up");
``` ```
```js ```js

View File

@ -330,7 +330,7 @@ context.grant_permissions(['notifications'], origin='https://skype.com')
``` ```
```csharp ```csharp
await context.GrantPermissionsAsync(new[] { "notifications" },origin: "https://skype.com"); await context.GrantPermissionsAsync(new[] { "notifications" }, origin: "https://skype.com");
``` ```
Revoke all permissions: Revoke all permissions:

View File

@ -251,7 +251,7 @@ class Program
await using var browser = await playwright.Chromium.LaunchAsync(); await using var browser = await playwright.Chromium.LaunchAsync();
var page = await browser.NewPageAsync(); var page = await browser.NewPageAsync();
page.Request += (_, request) => Console.WriteLine(">> " + request.Method + " " + request.Url); page.Request += (_, request) => Console.WriteLine(">> " + request.Method + " " + request.Url);
page.Response += (_, response) => Console.WriteLine("<<" + response.Status + " " + response.Url); page.Response += (_, response) => Console.WriteLine("<< " + response.Status + " " + response.Url);
await page.GotoAsync("https://example.com"); await page.GotoAsync("https://example.com");
} }
} }

5
types/types.d.ts vendored
View File

@ -5813,8 +5813,9 @@ export interface Frame {
* If a page opens another page, e.g. with a `window.open` call, the popup will belong to the parent page's browser * If a page opens another page, e.g. with a `window.open` call, the popup will belong to the parent page's browser
* context. * context.
* *
* Playwright allows creation of "incognito" browser contexts with `browser.newContext()` method. "Incognito" browser * Playwright allows creating "incognito" browser contexts with
* contexts don't write any browsing data to disk. * [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context) method. "Incognito"
* browser contexts don't write any browsing data to disk.
* *
* ```js * ```js
* // Create a new incognito browser context * // Create a new incognito browser context