feat: add Puppeteer integration for web downloads
This introduces a new Puppeteer-based mechanism for downloading web content. It provides a flexible way to manipulate pages during downloads, enhancing the ability to handle dynamic content and improve the overall download process.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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; }
|
||||
|
||||
static PuppetContext() {
|
||||
Playwright = new Lazy<IPlaywright>(() => Microsoft.Playwright.Playwright.CreateAsync().Result);
|
||||
Browser = new Lazy<IBrowser>(() => Playwright.Value.Chromium.LaunchAsync().Result);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user