Files
Beam/Beam.Puppeteer/PuppetContext.cs
T
2025-06-25 22:12:19 +03:00

21 lines
605 B
C#

using Microsoft.Playwright;
namespace Beam.Puppeteer {
public delegate Task AsyncManipulator(IPage page);
public static class PuppetContext {
public static Lazy<IPlaywright> Playwright { get; set; }
public static Lazy<IBrowser> Browser { get; set; }
//public static Task<IBrowser> OpenBrowser() {
//}
static PuppetContext() {
Playwright = new Lazy<IPlaywright>(() => Microsoft.Playwright.Playwright.CreateAsync().Result);
Browser = new Lazy<IBrowser>(() => Playwright.Value.Chromium.LaunchAsync().Result);
}
}
}