21 lines
605 B
C#
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);
|
|
}
|
|
}
|
|
|
|
}
|