docs(dotnet): fix .NET code example (#9415)
Co-authored-by: Max Schmitt <max@schmitt.mx>
This commit is contained in:
parent
876e08315b
commit
8ae926efbf
|
|
@ -163,7 +163,7 @@ class PlaywrightExample
|
||||||
{
|
{
|
||||||
using var playwright = await Playwright.CreateAsync();
|
using var playwright = await Playwright.CreateAsync();
|
||||||
await using var browser = await playwright.Webkit.LaunchAsync();
|
await using var browser = await playwright.Webkit.LaunchAsync();
|
||||||
await using var context = await browser.NewContextAsync(Playwright.Devices["iPhone 6"]);
|
await using var context = await browser.NewContextAsync(playwright.Devices["iPhone 6"]);
|
||||||
|
|
||||||
var page = await context.NewPageAsync();
|
var page = await context.NewPageAsync();
|
||||||
await page.GotoAsync("https://www.theverge.com");
|
await page.GotoAsync("https://www.theverge.com");
|
||||||
|
|
|
||||||
|
|
@ -214,7 +214,7 @@ class PlaywrightExample
|
||||||
{
|
{
|
||||||
using var playwright = await Playwright.CreateAsync();
|
using var playwright = await Playwright.CreateAsync();
|
||||||
await using var browser = await playwright.Webkit.LaunchAsync();
|
await using var browser = await playwright.Webkit.LaunchAsync();
|
||||||
var options = new BrowserContextNewOptions(Playwright.Devices["iPhone 11 Pro"])
|
var options = new BrowserNewContextOptions(playwright.Devices["iPhone 11 Pro"])
|
||||||
{
|
{
|
||||||
Geolocation = new() { Longitude = 12.492507f, Latitude = 41.889938f },
|
Geolocation = new() { Longitude = 12.492507f, Latitude = 41.889938f },
|
||||||
Permissions = new[] { "geolocation" },
|
Permissions = new[] { "geolocation" },
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue