Skip to content

v0.3 Launcher Improvements

Compare
Choose a tag to compare
@kblok kblok released this 18 Mar 15:23
· 1198 commits to master since this release
d98f9c6
  • Fixed Process leak.
  • User data dir support.
var userDataDir = Launcher.GetTemporaryDirectory();
var options = TestConstants.DefaultBrowserOptions();
options.UserDataDir = userDataDir;

var launcher = new Launcher();
var browser = await launcher.LaunchAsync(options, TestConstants.ChromiumRevision);
  • Browser and Page now implements IDisposable.
var options = TestConstants.DefaultBrowserOptions();

using (var browser = await PuppeteerSharp.Puppeteer.LaunchAsync(options, TestConstants.ChromiumRevision))
using (var page = await browser.NewPageAsync())
{
    var response = await page.GoToAsync("https://www.google.com");
}